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



2553
2554
2555
2556
# File 'lib/yarp/node.rb', line 2553

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

Instance Attribute Details

#blockObject (readonly)

attr_reader block: Node?



2550
2551
2552
# File 'lib/yarp/node.rb', line 2550

def block
  @block
end

Instance Method Details

#accept(visitor) ⇒ Object

def accept: (visitor: Visitor) -> void



2559
2560
2561
# File 'lib/yarp/node.rb', line 2559

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

#child_nodesObject Also known as: deconstruct

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



2565
2566
2567
# File 'lib/yarp/node.rb', line 2565

def child_nodes
  [block]
end

#deconstruct_keys(keys) ⇒ Object

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



2573
2574
2575
# File 'lib/yarp/node.rb', line 2573

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