class SyntaxTree::YARV::DupHash

### Summary

‘duphash` dups a Hash literal and pushes it onto the stack.

### Usage

~~~ruby { a: 1 } ~~~

Attributes

object[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1315
def ==(other)
  other.is_a?(DupHash) && other.object == object
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1327
def call(vm)
  vm.push(object.dup)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1311
def deconstruct_keys(_keys)
  { object: object }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1303
def disasm(fmt)
  fmt.instruction("duphash", [fmt.object(object)])
end
length() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1319
def length
  2
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1323
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 1307
def to_a(_iseq)
  [:duphash, object]
end