class SyntaxTree::YARV::DupArray

### Summary

‘duparray` dups an Array literal and pushes it onto the stack.

### Usage

~~~ruby

true

~~~

Attributes

object[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1269
def ==(other)
  other.is_a?(DupArray) && other.object == object
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1281
def call(vm)
  vm.push(object.dup)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1265
def deconstruct_keys(_keys)
  { object: object }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1257
def disasm(fmt)
  fmt.instruction("duparray", [fmt.object(object)])
end
length() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1273
def length
  2
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1277
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1261
def to_a(_iseq)
  [:duparray, object]
end