Class: SyntaxTree::WordsBeg

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

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

Instance Method Summary collapse

Methods inherited from Node

#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ WordsBeg

Returns a new instance of WordsBeg.



11728
11729
11730
11731
# File 'lib/syntax_tree/node.rb', line 11728

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



11726
11727
11728
# File 'lib/syntax_tree/node.rb', line 11726

def location
  @location
end

#valueObject (readonly)

String

the start of the word literal array



11723
11724
11725
# File 'lib/syntax_tree/node.rb', line 11723

def value
  @value
end