class Stack
Attributes
stack[RW]
Public Class Methods
new()
click to toggle source
# File lib/honey_mushroom/stack.rb, line 3 def initialize @stack = [] end
Public Instance Methods
peek()
click to toggle source
# File lib/honey_mushroom/stack.rb, line 16 def peek stack[-1] end
pop()
click to toggle source
# File lib/honey_mushroom/stack.rb, line 12 def pop stack.pop end
push(value)
click to toggle source
# File lib/honey_mushroom/stack.rb, line 7 def push(value) stack.push(value) return value end