class SyntaxTree::YARV::GetBlockParamProxy
### Summary
‘getblockparamproxy` is almost the same as `getblockparam` except that it pushes a proxy object onto the stack instead of the actual value of the block local. This is used when a method is being called on the block local.
### Usage
~~~ruby def foo(&block)
block.call
end ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1597 def initialize(index, level) @index = index @level = level end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1619 def ==(other) other.is_a?(GetBlockParamProxy) && other.index == index && other.level == level end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1632 def call(vm) vm.push(vm.local_get(index, level)) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1615 def deconstruct_keys(_keys) { index: index, level: level } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1602 def disasm(fmt) fmt.instruction( "getblockparamproxy", [fmt.local(index, explicit: level)] ) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1609 def to_a(iseq) current = iseq level.times { current = iseq.parent_iseq } [:getblockparamproxy, current.local_table.offset(index), level] end