Class: YARP::XStringNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::XStringNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents an xstring literal with no interpolation.
`foo`
^^^^^
Instance Attribute Summary collapse
-
#closing_loc ⇒ Object
readonly
attr_reader closing_loc: Location.
-
#content_loc ⇒ Object
readonly
attr_reader content_loc: Location.
-
#opening_loc ⇒ Object
readonly
attr_reader opening_loc: Location.
-
#unescaped ⇒ Object
readonly
attr_reader unescaped: String.
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.
-
#content ⇒ Object
def content: () -> String.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(opening_loc, content_loc, closing_loc, unescaped, location) ⇒ XStringNode
constructor
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void.
-
#opening ⇒ Object
def opening: () -> String.
Constructor Details
#initialize(opening_loc, content_loc, closing_loc, unescaped, location) ⇒ XStringNode
def initialize: (opening_loc: Location, content_loc: Location, closing_loc: Location, unescaped: String, location: Location) -> void
6300 6301 6302 6303 6304 6305 6306 |
# File 'lib/yarp/node.rb', line 6300 def initialize(opening_loc, content_loc, closing_loc, unescaped, location) @opening_loc = opening_loc @content_loc = content_loc @closing_loc = closing_loc @unescaped = unescaped @location = location end |
Instance Attribute Details
#closing_loc ⇒ Object (readonly)
attr_reader closing_loc: Location
6294 6295 6296 |
# File 'lib/yarp/node.rb', line 6294 def closing_loc @closing_loc end |
#content_loc ⇒ Object (readonly)
attr_reader content_loc: Location
6291 6292 6293 |
# File 'lib/yarp/node.rb', line 6291 def content_loc @content_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
6288 6289 6290 |
# File 'lib/yarp/node.rb', line 6288 def opening_loc @opening_loc end |
#unescaped ⇒ Object (readonly)
attr_reader unescaped: String
6297 6298 6299 |
# File 'lib/yarp/node.rb', line 6297 def unescaped @unescaped end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
6309 6310 6311 |
# File 'lib/yarp/node.rb', line 6309 def accept(visitor) visitor.visit_x_string_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
6314 6315 6316 |
# File 'lib/yarp/node.rb', line 6314 def child_nodes [] end |
#closing ⇒ Object
def closing: () -> String
6337 6338 6339 |
# File 'lib/yarp/node.rb', line 6337 def closing closing_loc.slice end |
#content ⇒ Object
def content: () -> String
6332 6333 6334 |
# File 'lib/yarp/node.rb', line 6332 def content content_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
6322 6323 6324 |
# File 'lib/yarp/node.rb', line 6322 def deconstruct_keys(keys) { opening_loc: opening_loc, content_loc: content_loc, closing_loc: closing_loc, unescaped: unescaped, location: location } end |
#opening ⇒ Object
def opening: () -> String
6327 6328 6329 |
# File 'lib/yarp/node.rb', line 6327 def opening opening_loc.slice end |