Class: SyntaxTree::TStringBeg

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

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

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(value:, location:) ⇒ TStringBeg

Returns a new instance of TStringBeg.



10271
10272
10273
10274
# File 'lib/syntax_tree/node.rb', line 10271

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

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



10269
10270
10271
# File 'lib/syntax_tree/node.rb', line 10269

def location
  @location
end

#valueObject (readonly)

String

the beginning of the string



10266
10267
10268
# File 'lib/syntax_tree/node.rb', line 10266

def value
  @value
end