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.
15 16 17 18 |
# File 'lib/raheui/store.rb', line 15 def initialize check_base_methods @store = [] end |
Instance Method Details
#push_dup ⇒ Object
Push the last element to Store.
21 22 23 |
# File 'lib/raheui/store.rb', line 21 def push_dup push(@store.last) if size > 0 end |