Class: KoiReferenceCompiler::HashAccessor

Inherits:
SyntaxNode
  • Object
show all
Defined in:
lib/koi-reference-compiler/node_extensions/hash_literals/hash_accessor.rb

Instance Attribute Summary

Attributes inherited from SyntaxNode

#elements, #offset, #parent, #text_value

Instance Method Summary collapse

Methods inherited from SyntaxNode

#initialize

Constructor Details

This class inherits a constructor from KoiReferenceCompiler::SyntaxNode

Instance Method Details

#compile_getObject



4
5
6
7
# File 'lib/koi-reference-compiler/node_extensions/hash_literals/hash_accessor.rb', line 4

def compile_get
  bytecode = self.elements.first.compile
  bytecode << GET_KEY
end

#compile_setObject



9
10
11
12
# File 'lib/koi-reference-compiler/node_extensions/hash_literals/hash_accessor.rb', line 9

def compile_set
  bytecode = self.elements.first.compile
  bytecode << SET_KEY
end