Class: SuckerPunch::Persistence::Mailbox
- Inherits:
-
Celluloid::Mailbox
- Object
- Celluloid::Mailbox
- SuckerPunch::Persistence::Mailbox
- Defined in:
- lib/sucker_punch/persistence/mailbox.rb
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize(data_store) ⇒ Mailbox
constructor
A new instance of Mailbox.
Constructor Details
#initialize(data_store) ⇒ Mailbox
Returns a new instance of Mailbox.
3 4 5 6 |
# File 'lib/sucker_punch/persistence/mailbox.rb', line 3 def initialize(data_store) super() self.data_store = data_store end |
Instance Method Details
#<<(message) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/sucker_punch/persistence/mailbox.rb', line 8 def <<() if .is_a?(::Celluloid::Call) && (arguments = .arguments.dup).shift == :perform record = data_store.create_record(arguments) .extend(SuckerPunch::Persistence::Call) .data_store = data_store .record = record end super end |