Class: YARP::ForwardingSuperNode

Inherits:
YARPNode
  • Object
show all
Defined in:
lib/yarp/node.rb,
ext/yarp/api_node.c

Overview

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

super
^^^^^

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block, location) ⇒ ForwardingSuperNode

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



2570
2571
2572
2573
# File 'lib/yarp/node.rb', line 2570

def initialize(block, location)
  @block = block
  @location = location
end

Instance Attribute Details

#blockObject (readonly)

attr_reader block: Node?



2567
2568
2569
# File 'lib/yarp/node.rb', line 2567

def block
  @block
end

Instance Method Details

#accept(visitor) ⇒ Object

def accept: (visitor: Visitor) -> void



2576
2577
2578
# File 'lib/yarp/node.rb', line 2576

def accept(visitor)
  visitor.visit_forwarding_super_node(self)
end

#child_nodesObject Also known as: deconstruct

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



2581
2582
2583
# File 'lib/yarp/node.rb', line 2581

def child_nodes
  [block]
end

#deconstruct_keys(keys) ⇒ Object

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



2589
2590
2591
# File 'lib/yarp/node.rb', line 2589

def deconstruct_keys(keys)
  { block: block, location: location }
end