class SyntaxTree::Super
Super
represents using the super
keyword with arguments. It can optionally use parentheses.
super(value)
Attributes
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 10436 def initialize(arguments:, location:) @arguments = arguments @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 10480 def ===(other) other.is_a?(Super) && arguments === other.arguments end
Source
# File lib/syntax_tree/node.rb, line 10442 def accept(visitor) visitor.visit_super(self) end
Source
# File lib/syntax_tree/node.rb, line 10446 def child_nodes [arguments] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 10450 def copy(arguments: nil, location: nil) node = Super.new( arguments: arguments || self.arguments, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 10463 def deconstruct_keys(_keys) { arguments: arguments, location: location, comments: comments } end
Source
# File lib/syntax_tree/node.rb, line 10467 def format(q) q.group do q.text("super") if arguments.is_a?(ArgParen) q.format(arguments) else q.text(" ") q.nest("super ".length) { q.format(arguments) } end end end