Class: GirlFriday::Store::InMemory

Inherits:
Object
  • Object
show all
Defined in:
lib/girl_friday/persistence.rb

Instance Method Summary collapse

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, options)
  @backlog = []
end

Instance Method Details

#popObject



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

#sizeObject



18
19
20
# File 'lib/girl_friday/persistence.rb', line 18

def size
  @backlog.size
end