Class: Highway::Compiler::Parse::Tree::Variable

Inherits:
Object
  • Object
show all
Defined in:
lib/highway/compiler/parse/tree/variable.rb

Overview

This class represents a variable node in a parse tree. It contains information about a single variable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, value:, preset:) ⇒ Variable

Initialize an instance.

Parameters:

  • name (String)

    Name of the variable.

  • value (String)

    Raw value of the variable.

  • preset (String)

    Parent preset of the variable.



22
23
24
25
26
# File 'lib/highway/compiler/parse/tree/variable.rb', line 22

def initialize(name:, value:, preset:)
  @name = name
  @value = value
  @preset = preset
end

Instance Attribute Details

#nameString (readonly)

Name of the variable.

Returns:

  • (String)


31
32
33
# File 'lib/highway/compiler/parse/tree/variable.rb', line 31

def name
  @name
end

#presetString (readonly)

Parent preset of the variable.

Returns:

  • (String)


41
42
43
# File 'lib/highway/compiler/parse/tree/variable.rb', line 41

def preset
  @preset
end

#valueString (readonly)

Raw value of the variable.

Returns:

  • (String)


36
37
38
# File 'lib/highway/compiler/parse/tree/variable.rb', line 36

def value
  @value
end