Class: SyntaxTree::WordsBeg
Overview
WordsBeg represents the beginning of a string literal array with interpolation.
%W[one two three]
In the snippet above, a WordsBeg would be created with the value of “%W[”. Note that these kinds of arrays can start with a lot of different delimiter types (e.g., %W| or %W<).
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- String
-
the start of the word literal array.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ WordsBeg
constructor
A new instance of WordsBeg.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ WordsBeg
Returns a new instance of WordsBeg.
9921 9922 9923 9924 |
# File 'lib/syntax_tree/node.rb', line 9921 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- String
-
the start of the word literal array
9919 9920 9921 |
# File 'lib/syntax_tree/node.rb', line 9919 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
9926 9927 9928 |
# File 'lib/syntax_tree/node.rb', line 9926 def accept(visitor) visitor.visit_words_beg(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
9930 9931 9932 |
# File 'lib/syntax_tree/node.rb', line 9930 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
9936 9937 9938 |
# File 'lib/syntax_tree/node.rb', line 9936 def deconstruct_keys(_keys) { value: value, location: location } end |