class YARP::ForwardingSuperNode

Represents the use of the ‘super` keyword without parentheses or arguments.

super
^^^^^

Attributes

block[R]

attr_reader block: BlockNode?

Public Class Methods

new(block, location) click to toggle source

def initialize: (block: BlockNode?, location: Location) -> void

# File yarp/node.rb, line 4533
def initialize(block, location)
  @block = block
  @location = location
end

Public Instance Methods

accept(visitor) click to toggle source

def accept: (visitor: Visitor) -> void

# File yarp/node.rb, line 4539
def accept(visitor)
  visitor.visit_forwarding_super_node(self)
end
child_nodes() click to toggle source

def child_nodes: () -> Array[nil | Node]

# File yarp/node.rb, line 4544
def child_nodes
  [block]
end
Also aliased as: deconstruct
comment_targets() click to toggle source

def comment_targets: () -> Array[Node | Location]

# File yarp/node.rb, line 4549
def comment_targets
  [*block]
end
copy(**params) click to toggle source

def copy: (**params) -> ForwardingSuperNode

# File yarp/node.rb, line 4554
def copy(**params)
  ForwardingSuperNode.new(
    params.fetch(:block) { block },
    params.fetch(:location) { location },
  )
end
deconstruct()

def deconstruct: () -> Array[nil | Node]

Alias for: child_nodes
deconstruct_keys(keys) click to toggle source

def deconstruct_keys: (keys: Array) -> Hash[Symbol, nil | Node | Array | String | Token | Array | Location]

# File yarp/node.rb, line 4565
def deconstruct_keys(keys)
  { block: block, location: location }
end
inspect(inspector = NodeInspector.new) click to toggle source
# File yarp/node.rb, line 4569
def inspect(inspector = NodeInspector.new)
  inspector << inspector.header(self)
  if (block = self.block).nil?
    inspector << "└── block: ∅\n"
  else
    inspector << "└── block:\n"
    inspector << block.inspect(inspector.child_inspector("    ")).delete_prefix(inspector.prefix)
  end
  inspector.to_str
end