class SyntaxTree::YARV::GetLocalWC0
### Summary
‘getlocal_WC_0` is a specialized version of the `getlocal` instruction. It fetches the value of a local variable from the current frame determined by the index given as its only argument.
### Usage
~~~ruby value = 5 value ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1936 def initialize(index) @index = index end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1952 def ==(other) other.is_a?(GetLocalWC0) && other.index == index end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1968 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1964 def canonical GetLocal.new(index, 0) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1948 def deconstruct_keys(_keys) { index: index } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1940 def disasm(fmt) fmt.instruction("getlocal_WC_0", [fmt.local(index, implicit: 0)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1944 def to_a(iseq) [:getlocal_WC_0, iseq.local_table.offset(index)] end