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.
-
#copy(**params) ⇒ Object
def copy: (**params) -> XStringNode.
- #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
7859 7860 7861 7862 7863 7864 7865 |
# File 'lib/yarp/node.rb', line 7859 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
7853 7854 7855 |
# File 'lib/yarp/node.rb', line 7853 def closing_loc @closing_loc end |
#content_loc ⇒ Object (readonly)
attr_reader content_loc: Location
7850 7851 7852 |
# File 'lib/yarp/node.rb', line 7850 def content_loc @content_loc end |
#opening_loc ⇒ Object (readonly)
attr_reader opening_loc: Location
7847 7848 7849 |
# File 'lib/yarp/node.rb', line 7847 def opening_loc @opening_loc end |
#unescaped ⇒ Object (readonly)
attr_reader unescaped: String
7856 7857 7858 |
# File 'lib/yarp/node.rb', line 7856 def unescaped @unescaped end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
7868 7869 7870 |
# File 'lib/yarp/node.rb', line 7868 def accept(visitor) visitor.visit_x_string_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
7873 7874 7875 |
# File 'lib/yarp/node.rb', line 7873 def child_nodes [] end |
#closing ⇒ Object
def closing: () -> String
7907 7908 7909 |
# File 'lib/yarp/node.rb', line 7907 def closing closing_loc.slice end |
#content ⇒ Object
def content: () -> String
7902 7903 7904 |
# File 'lib/yarp/node.rb', line 7902 def content content_loc.slice end |
#copy(**params) ⇒ Object
def copy: (**params) -> XStringNode
7878 7879 7880 7881 7882 7883 7884 7885 7886 |
# File 'lib/yarp/node.rb', line 7878 def copy(**params) XStringNode.new( params.fetch(:opening_loc) { opening_loc }, params.fetch(:content_loc) { content_loc }, params.fetch(:closing_loc) { closing_loc }, params.fetch(:unescaped) { unescaped }, params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
7892 7893 7894 |
# File 'lib/yarp/node.rb', line 7892 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
7897 7898 7899 |
# File 'lib/yarp/node.rb', line 7897 def opening opening_loc.slice end |