Module: Jack::Queues::Mock
- Defined in:
- lib/jack/queues/mock.rb
Instance Method Summary collapse
- #connection ⇒ Object
- #create(name_or_data, data = nil) ⇒ Object
- #created ⇒ Object
- #delete(message) ⇒ Object
- #messages ⇒ Object
Instance Method Details
#connection ⇒ Object
4 5 6 |
# File 'lib/jack/queues/mock.rb', line 4 def connection @connection ||= [] end |
#create(name_or_data, data = nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/jack/queues/mock.rb', line 16 def create(name_or_data, data = nil) if data.nil? data = name_or_data name_or_data = @queue_name end created << [name_or_data, data] end |
#created ⇒ Object
24 25 26 |
# File 'lib/jack/queues/mock.rb', line 24 def created @created ||= [] end |
#delete(message) ⇒ Object
12 13 14 |
# File 'lib/jack/queues/mock.rb', line 12 def delete() .delete end |
#messages ⇒ Object
8 9 10 |
# File 'lib/jack/queues/mock.rb', line 8 def @messages ||= (connection.shift || []) end |