Class: SyntaxTree::TStringEnd
Overview
TStringEnd represents the end of a string literal.
"string"
In the example above, TStringEnd represents the second set of quotes. Strings can also use single quotes. They can also be declared using the %q and %Q syntax, as in:
%q{string}
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the end of the string.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:, location:) ⇒ TStringEnd
constructor
A new instance of TStringEnd.
Methods inherited from Node
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TStringEnd
Returns a new instance of TStringEnd.
8689 8690 8691 8692 |
# File 'lib/syntax_tree/node.rb', line 8689 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the end of the string
8687 8688 8689 |
# File 'lib/syntax_tree/node.rb', line 8687 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8694 8695 8696 |
# File 'lib/syntax_tree/node.rb', line 8694 def accept(visitor) visitor.visit_tstring_end(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8698 8699 8700 |
# File 'lib/syntax_tree/node.rb', line 8698 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
8704 8705 8706 |
# File 'lib/syntax_tree/node.rb', line 8704 def deconstruct_keys(keys) { value: value, location: location } end |