class SyntaxTree::YARV::OptAset
### Summary
‘opt_aset` is an instruction for setting the hash value by the key in the `recv = set` format. It is a specialization of the `opt_send_without_block` instruction. It pops the receiver, the key, and the value off the stack and pushes on the result.
### Usage
Attributes
calldata[R]
Public Class Methods
new(calldata)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2842 def initialize(calldata) @calldata = calldata end
Public Instance Methods
==(other)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2858 def ==(other) other.is_a?(OptAset) && other.calldata == calldata end
call(vm)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2878 def call(vm) canonical.call(vm) end
canonical()
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2874 def canonical Send.new(calldata, nil) end
deconstruct_keys(_keys)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2854 def deconstruct_keys(_keys) { calldata: calldata } end
disasm(fmt)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2846 def disasm(fmt) fmt.instruction("opt_aset", [fmt.calldata(calldata)]) end
length()
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2862 def length 2 end
pops()
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2866 def pops 3 end
pushes()
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2870 def pushes 1 end
to_a(_iseq)
click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2850 def to_a(_iseq) [:opt_aset, calldata.to_h] end