class SyntaxTree::YARV::NewArrayKwSplat
### Summary
‘newarraykwsplat` is a specialized version of `newarray` that takes a ** splat argument. It pops `number` values off the stack and pushes the array onto the stack.
### Usage
~~~ruby
- “string”, **{ foo: “bar” }
-
~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2419 def initialize(number) @number = number end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2435 def ==(other) other.is_a?(NewArrayKwSplat) && other.number == number end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2451 def call(vm) vm.push(vm.pop(number)) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2431 def deconstruct_keys(_keys) { number: number } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2423 def disasm(fmt) fmt.instruction("newarraykwsplat", [fmt.object(number)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 2427 def to_a(_iseq) [:newarraykwsplat, number] end