Class: SyntaxTree::ZSuper
- Inherits:
-
Node
- Object
- Node
- SyntaxTree::ZSuper
show all
- Defined in:
- lib/syntax_tree/node.rb
Overview
ZSuper represents the bare super keyword with no arguments.
super
Instance Attribute Summary collapse
Attributes inherited from Node
#location
Instance Method Summary
collapse
Methods inherited from Node
#construct_keys, #end_char, #pretty_print, #start_char, #to_json, #to_mermaid
Constructor Details
#initialize(location:) ⇒ ZSuper
Returns a new instance of ZSuper.
12299
12300
12301
12302
|
# File 'lib/syntax_tree/node.rb', line 12299
def initialize(location:)
@location = location
= []
end
|
Instance Attribute Details
- Array[ Comment | EmbDoc ]
-
the comments attached to this node
12297
12298
12299
|
# File 'lib/syntax_tree/node.rb', line 12297
def
end
|
Instance Method Details
#===(other) ⇒ Object
12329
12330
12331
|
# File 'lib/syntax_tree/node.rb', line 12329
def ===(other)
other.is_a?(ZSuper)
end
|
#accept(visitor) ⇒ Object
12304
12305
12306
|
# File 'lib/syntax_tree/node.rb', line 12304
def accept(visitor)
visitor.visit_zsuper(self)
end
|
#child_nodes ⇒ Object
Also known as:
deconstruct
12308
12309
12310
|
# File 'lib/syntax_tree/node.rb', line 12308
def child_nodes
[]
end
|
#copy(location: nil) ⇒ Object
12312
12313
12314
12315
12316
12317
|
# File 'lib/syntax_tree/node.rb', line 12312
def copy(location: nil)
node = ZSuper.new(location: location || self.location)
node..concat(.map(&:copy))
node
end
|
#deconstruct_keys(_keys) ⇒ Object
12321
12322
12323
|
# File 'lib/syntax_tree/node.rb', line 12321
def deconstruct_keys(_keys)
{ location: location, comments: }
end
|
12325
12326
12327
|
# File 'lib/syntax_tree/node.rb', line 12325
def format(q)
q.text("super")
end
|