class SyntaxTree::YARV::Legacy::OptNewArrayMin
### Summary
‘opt_newarray_min` is a specialization that occurs when the `min` method is called on an array literal. It pops the values of the array off the stack and pushes on the result.
### Usage
~~~ruby [a, b, c].min ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/legacy.rb, line 194 def initialize(number) @number = number end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/legacy.rb, line 210 def ==(other) other.is_a?(OptNewArrayMin) && other.number == number end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 226 def call(vm) vm.push(vm.pop(number).min) end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 206 def deconstruct_keys(_keys) { number: number } end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 198 def disasm(fmt) fmt.instruction("opt_newarray_min", [fmt.object(number)]) end
Source
# File lib/syntax_tree/yarv/legacy.rb, line 202 def to_a(_iseq) [:opt_newarray_min, number] end