Class: SyntaxTree::TStringBeg
Overview
TStringBeg represents the beginning of a string literal.
"string"
In the example above, TStringBeg represents the first 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 beginning 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:) ⇒ TStringBeg
constructor
A new instance of TStringBeg.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ TStringBeg
Returns a new instance of TStringBeg.
8895 8896 8897 8898 |
# File 'lib/syntax_tree/node.rb', line 8895 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the beginning of the string
8893 8894 8895 |
# File 'lib/syntax_tree/node.rb', line 8893 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8900 8901 8902 |
# File 'lib/syntax_tree/node.rb', line 8900 def accept(visitor) visitor.visit_tstring_beg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8904 8905 8906 |
# File 'lib/syntax_tree/node.rb', line 8904 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8910 8911 8912 |
# File 'lib/syntax_tree/node.rb', line 8910 def deconstruct_keys(_keys) { value: value, location: location } end |