Class: Mailclerk::Outbox
- Inherits:
-
Array
- Object
- Array
- Mailclerk::Outbox
- Defined in:
- lib/outbox.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
Instance Method Summary collapse
- #add_send(request, response) ⇒ Object
- #enable ⇒ Object
-
#filter(query) ⇒ Object
Not just an alias for ‘select’.
-
#initialize ⇒ Outbox
constructor
A new instance of Outbox.
- #reset ⇒ Object
Constructor Details
#initialize ⇒ Outbox
Returns a new instance of Outbox.
5 6 7 |
# File 'lib/outbox.rb', line 5 def initialize self.enabled = false end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
3 4 5 |
# File 'lib/outbox.rb', line 3 def enabled @enabled end |
Instance Method Details
#add_send(request, response) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/outbox.rb', line 26 def add_send(request, response) email = OutboxEmail.new( OutboxEmail.recursive_init( response.merge(request) ) ) self << email end |
#enable ⇒ Object
9 10 11 |
# File 'lib/outbox.rb', line 9 def enable self.enabled = true end |
#filter(query) ⇒ Object
Not just an alias for ‘select’
18 19 20 21 22 23 24 |
# File 'lib/outbox.rb', line 18 def filter(query) self.select do |email| query.all? do |key, value| email[key] == value end end end |
#reset ⇒ Object
13 14 15 |
# File 'lib/outbox.rb', line 13 def reset self.clear end |