Class: StarlarkCompiler::AST::Dictionary

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(elements) ⇒ Dictionary

Returns a new instance of Dictionary.



161
162
163
# File 'lib/starlark_compiler/ast.rb', line 161

def initialize(elements)
  @elements = Hash[elements.map { |k, v| [node(k), node(v)] }]
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



160
161
162
# File 'lib/starlark_compiler/ast.rb', line 160

def elements
  @elements
end