Class: StarlarkCompiler::AST::VariableAssignment
- Defined in:
- lib/starlark_compiler/ast.rb
Constant Summary collapse
- TYPE =
:Statement
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#var ⇒ Object
readonly
Returns the value of attribute var.
Instance Method Summary collapse
-
#initialize(name, var) ⇒ VariableAssignment
constructor
A new instance of VariableAssignment.
Constructor Details
#initialize(name, var) ⇒ VariableAssignment
Returns a new instance of VariableAssignment.
127 128 129 130 131 132 133 134 |
# File 'lib/starlark_compiler/ast.rb', line 127 def initialize(name, var) @name = name if node(var).class::TYPE != :Expression raise "Unsupported type on rhs for assignment: #{var.class}" end @var = node(var) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
126 127 128 |
# File 'lib/starlark_compiler/ast.rb', line 126 def name @name end |
#var ⇒ Object (readonly)
Returns the value of attribute var.
126 127 128 |
# File 'lib/starlark_compiler/ast.rb', line 126 def var @var end |