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

number[R]

Public Class Methods

new(number) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2366
def initialize(number)
  @number = number
end

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2382
def ==(other)
  other.is_a?(NewArrayKwSplat) && other.number == number
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2398
def call(vm)
  vm.push(vm.pop(number))
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2378
def deconstruct_keys(_keys)
  { number: number }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2370
def disasm(fmt)
  fmt.instruction("newarraykwsplat", [fmt.object(number)])
end
length() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2386
def length
  2
end
pops() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2390
def pops
  number
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2394
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 2374
def to_a(_iseq)
  [:newarraykwsplat, number]
end