Class: Raheui::Store

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/raheui/store.rb

Overview

Base Store class for Aheui. Every child classes should implement push, pop and swap method.

Direct Known Subclasses

Port, Queue, Stack

Instance Method Summary collapse

Constructor Details

#initializeStore

Initialize a Stack.



18
19
20
21
# File 'lib/raheui/store.rb', line 18

def initialize
  check_base_methods
  @store = []
end

Instance Method Details

#push_dupObject

Push the last element to Store.



24
25
26
# File 'lib/raheui/store.rb', line 24

def push_dup
  push(@store.last) if size > 0
end