class SyntaxTree::YARV::OptStrUMinus

### Summary

‘opt_str_uminus` pushes a frozen known string value with no interpolation onto the stack. If the method gets overridden, this will fall back to a send.

### Usage

~~~ruby -“string” ~~~

Attributes

calldata[R]
object[R]

Public Class Methods

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

Public Instance Methods

==(other) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4360
def ==(other)
  other.is_a?(OptStrUMinus) && other.object == object &&
    other.calldata == calldata
end
call(vm) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4373
def call(vm)
  vm.push(-object)
end
deconstruct_keys(_keys) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4356
def deconstruct_keys(_keys)
  { object: object, calldata: calldata }
end
disasm(fmt) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4345
def disasm(fmt)
  fmt.instruction(
    "opt_str_uminus",
    [fmt.object(object), fmt.calldata(calldata)]
  )
end
length() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4365
def length
  3
end
pushes() click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4369
def pushes
  1
end
to_a(_iseq) click to toggle source
# File lib/syntax_tree/yarv/instructions.rb, line 4352
def to_a(_iseq)
  [:opt_str_uminus, object, calldata.to_h]
end