Class: Rotary::Storage::Memory
- Inherits:
-
Object
- Object
- Rotary::Storage::Memory
- Defined in:
- lib/rotary/storage/memory.rb
Class Method Summary collapse
-
.default_connection ⇒ Object
just to make it compatible.
Instance Method Summary collapse
- #clear ⇒ Object
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #pop ⇒ Object
- #push(session) ⇒ Object
- #size ⇒ Object
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
5 6 7 |
# File 'lib/rotary/storage/memory.rb', line 5 def initialize(*) clear end |
Class Method Details
.default_connection ⇒ Object
just to make it compatible
27 28 29 |
# File 'lib/rotary/storage/memory.rb', line 27 def self.default_connection self end |
Instance Method Details
#clear ⇒ Object
22 23 24 |
# File 'lib/rotary/storage/memory.rb', line 22 def clear @storage = [] end |
#pop ⇒ Object
14 15 16 |
# File 'lib/rotary/storage/memory.rb', line 14 def pop @storage.pop end |
#push(session) ⇒ Object
9 10 11 12 |
# File 'lib/rotary/storage/memory.rb', line 9 def push(session) @storage.unshift(session) self end |
#size ⇒ Object
18 19 20 |
# File 'lib/rotary/storage/memory.rb', line 18 def size @storage.size end |