Class: YARP::EmbeddedStatementsNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::EmbeddedStatementsNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents an interpolated set of statements.
"foo #{bar}"
^^^^^^
Instance Attribute Summary collapse
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location.
-
#statements ⇒ Object
readonly
attr_reader statements: StatementsNode?.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#closing ⇒ Object
def closing: () -> String.
-
#copy(**params) ⇒ Object
def copy: (**params) -> EmbeddedStatementsNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening_loc, statements, closing_loc, location) ⇒ EmbeddedStatementsNode
constructor
def initialize: (opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location) -> void.
-
#opening ⇒ Object
def opening: () -> String.
Constructor Details
#initialize(opening_loc, statements, closing_loc, location) ⇒ EmbeddedStatementsNode
def initialize: (opening_loc: Location, statements: StatementsNode?, closing_loc: Location, location: Location) -> void
2665 2666 2667 2668 2669 2670 |
# File 'lib/yarp/node.rb', line 2665 def initialize(opening_loc, statements, closing_loc, location) @opening_loc = opening_loc @statements = statements @closing_loc = closing_loc @location = location end |
Instance Attribute Details
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location
2662 2663 2664 |
# File 'lib/yarp/node.rb', line 2662 def closing_loc @closing_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
2656 2657 2658 |
# File 'lib/yarp/node.rb', line 2656 def opening_loc @opening_loc end |
#statements ⇒ Object (readonly)
attr_reader statements: StatementsNode?
2659 2660 2661 |
# File 'lib/yarp/node.rb', line 2659 def statements @statements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
2673 2674 2675 |
# File 'lib/yarp/node.rb', line 2673 def accept(visitor) visitor.(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
2678 2679 2680 |
# File 'lib/yarp/node.rb', line 2678 def child_nodes [statements] end |
#closing ⇒ Object
def closing: () -> String
2706 2707 2708 |
# File 'lib/yarp/node.rb', line 2706 def closing closing_loc.slice end |
#copy(**params) ⇒ Object
def copy: (**params) -> EmbeddedStatementsNode
2683 2684 2685 2686 2687 2688 2689 2690 |
# File 'lib/yarp/node.rb', line 2683 def copy(**params) EmbeddedStatementsNode.new( params.fetch(:opening_loc) { opening_loc }, params.fetch(:statements) { statements }, params.fetch(:closing_loc) { closing_loc }, params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
2696 2697 2698 |
# File 'lib/yarp/node.rb', line 2696 def deconstruct_keys(keys) { opening_loc: opening_loc, statements: statements, closing_loc: closing_loc, location: location } end |
#opening ⇒ Object
def opening: () -> String
2701 2702 2703 |
# File 'lib/yarp/node.rb', line 2701 def opening opening_loc.slice end |