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
6254 6255 6256 6257 6258 6259 6260 |
# File 'lib/yarp/node.rb', line 6254 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
6248 6249 6250 |
# File 'lib/yarp/node.rb', line 6248 def closing_loc @closing_loc end |
#content_loc ⇒ Object (readonly)
attr_reader content_loc: Location
6245 6246 6247 |
# File 'lib/yarp/node.rb', line 6245 def content_loc @content_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
6242 6243 6244 |
# File 'lib/yarp/node.rb', line 6242 def opening_loc @opening_loc end |
#unescaped ⇒ Object (readonly)
attr_reader unescaped: String
6251 6252 6253 |
# File 'lib/yarp/node.rb', line 6251 def unescaped @unescaped end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
6263 6264 6265 |
# File 'lib/yarp/node.rb', line 6263 def accept(visitor) visitor.visit_x_string_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
6269 6270 6271 |
# File 'lib/yarp/node.rb', line 6269 def child_nodes [] end |
#closing ⇒ Object
def closing: () -> String
6292 6293 6294 |
# File 'lib/yarp/node.rb', line 6292 def closing closing_loc.slice end |
#content ⇒ Object
def content: () -> String
6287 6288 6289 |
# File 'lib/yarp/node.rb', line 6287 def content content_loc.slice end |
#deconstruct_keys(keys) ⇒ Object
6277 6278 6279 |
# File 'lib/yarp/node.rb', line 6277 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
6282 6283 6284 |
# File 'lib/yarp/node.rb', line 6282 def opening opening_loc.slice end |