Class: SyntaxTree::QWordsBeg

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

Overview

QWordsBeg represents the beginning of a string literal array.

%w[one two three]

In the snippet above, QWordsBeg represents the “%w[” token. 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

Constructor Details

#initialize(value:, location:) ⇒ QWordsBeg

Returns a new instance of QWordsBeg.



9726
9727
9728
9729
# File 'lib/syntax_tree.rb', line 9726

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

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9724
9725
9726
# File 'lib/syntax_tree.rb', line 9724

def location
  @location
end

#valueObject (readonly)

String

the beginning of the array literal



9721
9722
9723
# File 'lib/syntax_tree.rb', line 9721

def value
  @value
end