class SyntaxTree::YARV::GetLocalWC1
### Summary
‘getlocal_WC_1` is a specialized version of the `getlocal` instruction. It fetches the value of a local variable from the parent frame determined by the index given as its only argument.
### Usage
~~~ruby value = 5 self.then { value } ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1989 def initialize(index) @index = index end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2005 def ==(other) other.is_a?(GetLocalWC1) && other.index == index end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2021 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2017 def canonical GetLocal.new(index, 1) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2001 def deconstruct_keys(_keys) { index: index } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1993 def disasm(fmt) fmt.instruction("getlocal_WC_1", [fmt.local(index, implicit: 1)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 1997 def to_a(iseq) [:getlocal_WC_1, iseq.parent_iseq.local_table.offset(index)] end