class Raheui::Stack

Stack class for Aheui.

Public Instance Methods

push_dup() click to toggle source

Push the last element to Stack.

# File lib/raheui/stack.rb, line 10
def push_dup
  push(@store.last) if size > 0
end
swap() click to toggle source

Swap the last two elements of Stack.

# File lib/raheui/stack.rb, line 15
def swap
  @store[-1], @store[-2] = @store[-2], @store[-1] if size > 1
end