Class: Rox::Core::CoreStack

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/core/roxx/core_stack.rb

Instance Method Summary collapse

Constructor Details

#initializeCoreStack

Returns a new instance of CoreStack.



4
5
6
# File 'lib/rox/core/roxx/core_stack.rb', line 4

def initialize
  @items = []
end

Instance Method Details

#peekObject



17
18
19
# File 'lib/rox/core/roxx/core_stack.rb', line 17

def peek
  @items[-1]
end

#popObject



13
14
15
# File 'lib/rox/core/roxx/core_stack.rb', line 13

def pop
  @items.pop
end

#push(item) ⇒ Object



8
9
10
11
# File 'lib/rox/core/roxx/core_stack.rb', line 8

def push(item)
  @items << item
  nil
end