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: Node?.
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.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening_loc, statements, closing_loc, location) ⇒ EmbeddedStatementsNode
constructor
def initialize: (opening_loc: Location, statements: Node?, 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: Node?, closing_loc: Location, location: Location) -> void
2137 2138 2139 2140 2141 2142 |
# File 'lib/yarp/node.rb', line 2137 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
2134 2135 2136 |
# File 'lib/yarp/node.rb', line 2134 def closing_loc @closing_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
2128 2129 2130 |
# File 'lib/yarp/node.rb', line 2128 def opening_loc @opening_loc end |
#statements ⇒ Object (readonly)
attr_reader statements: Node?
2131 2132 2133 |
# File 'lib/yarp/node.rb', line 2131 def statements @statements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
2145 2146 2147 |
# File 'lib/yarp/node.rb', line 2145 def accept(visitor) visitor.(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
2151 2152 2153 |
# File 'lib/yarp/node.rb', line 2151 def child_nodes [statements] end |
#closing ⇒ Object
def closing: () -> String
2169 2170 2171 |
# File 'lib/yarp/node.rb', line 2169 def closing closing_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
2159 2160 2161 |
# File 'lib/yarp/node.rb', line 2159 def deconstruct_keys(keys) { opening_loc: opening_loc, statements: statements, closing_loc: closing_loc, location: location } end |
#opening ⇒ Object
def opening: () -> String
2164 2165 2166 |
# File 'lib/yarp/node.rb', line 2164 def opening opening_loc.slice end |