class SyntaxTree::Else
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/syntax_tree/node.rbs class SyntaxTree::Else < SyntaxTree::Node def accept: (Visitor visitor) -> untyped def initialize: (keyword: SyntaxTree::Kw, statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void end
end
else
if variable
Else represents the end of an if
, unless
, or case
chain.
def ===(other)
def ===(other) other.is_a?(Else) && keyword === other.keyword && statements === other.statements end
def accept(visitor)
Experimental RBS support (using type sampling data from the type_fusion
project).
def accept: (Visitor visitor) -> untyped
This signature was generated using 3 samples from 1 application.
def accept(visitor) visitor.visit_else(self) end
def child_nodes
def child_nodes [keyword, statements] end
def copy(keyword: nil, statements: nil, location: nil)
def copy(keyword: nil, statements: nil, location: nil) node = Else.new( keyword: keyword || self.keyword, statements: statements || self.statements, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { keyword: keyword, statements: statements, location: location, comments: comments } end
def format(q)
def format(q) q.group do q.format(keyword) unless statements.empty? q.indent do q.breakable_force q.format(statements) end end end end
def initialize(keyword:, statements:, location:)
Experimental RBS support (using type sampling data from the type_fusion
project).
def initialize: (keyword: SyntaxTree::Kw, statements: SyntaxTree::Statements, location: SyntaxTree::Location) -> void
This signature was generated using 1 sample from 1 application.
def initialize(keyword:, statements:, location:) @keyword = keyword @statements = statements @location = location @comments = [] end