class SyntaxTree::YARV::TopN
~~~
end
puts “foo”
when 1..5
case 3
~~~ruby
### Usage
within the stack that is ‘number` of slots down from the top.
`topn` pushes a single value onto the stack that is a copy of the value
### Summary
def ==(other)
def ==(other) other.is_a?(TopN) && other.number == number end
def call(vm)
def call(vm) vm.push(vm.stack[-number - 1]) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { number: number } end
def disasm(fmt)
def disasm(fmt) fmt.instruction("topn", [fmt.object(number)]) end
def initialize(number)
def initialize(number) @number = number end
def length
def length 2 end
def pushes
def pushes 1 end
def to_a(_iseq)
def to_a(_iseq) [:topn, number] end