Class: GirlFriday::Store::InMemory
- Inherits:
-
Object
- Object
- GirlFriday::Store::InMemory
- Defined in:
- lib/girl_friday/persistence.rb
Instance Method Summary collapse
-
#initialize(name, options) ⇒ InMemory
constructor
A new instance of InMemory.
- #pop ⇒ Object
- #push(work) ⇒ Object (also: #<<)
- #size ⇒ Object
Constructor Details
#initialize(name, options) ⇒ InMemory
Returns a new instance of InMemory.
5 6 7 |
# File 'lib/girl_friday/persistence.rb', line 5 def initialize(name, ) @backlog = [] end |
Instance Method Details
#pop ⇒ Object
14 15 16 |
# File 'lib/girl_friday/persistence.rb', line 14 def pop @backlog.shift end |
#push(work) ⇒ Object Also known as: <<
9 10 11 |
# File 'lib/girl_friday/persistence.rb', line 9 def push(work) @backlog << work end |
#size ⇒ Object
18 19 20 |
# File 'lib/girl_friday/persistence.rb', line 18 def size @backlog.size end |