Class: Raheui::Store
- Inherits:
-
Object
- Object
- Raheui::Store
- 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.
Instance Method Summary collapse
-
#initialize ⇒ Store
constructor
Initialize a Stack.
-
#push_dup ⇒ Object
Push the last element to Store.
Constructor Details
#initialize ⇒ Store
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_dup ⇒ Object
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 |