Class: StarlarkCompiler::AST::VariableReference

Inherits:
Node
  • Object
show all
Defined in:
lib/starlark_compiler/ast.rb

Constant Summary

Constants inherited from Node

Node::TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(var) ⇒ VariableReference

Returns a new instance of VariableReference.



108
109
110
111
112
113
114
# File 'lib/starlark_compiler/ast.rb', line 108

def initialize(var)
  unless var.is_a?(::String)
    raise "Variable Reference must be a string, not #{var.class}"
  end

  @var = var
end

Instance Attribute Details

#varObject (readonly)

Returns the value of attribute var.



107
108
109
# File 'lib/starlark_compiler/ast.rb', line 107

def var
  @var
end