Class: Letterbox::Address
- Inherits:
-
Object
- Object
- Letterbox::Address
- Includes:
- Celluloid
- Defined in:
- lib/letterbox/address.rb
Instance Attribute Summary collapse
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
-
#unit_of_work ⇒ Object
readonly
Returns the value of attribute unit_of_work.
Instance Method Summary collapse
-
#initialize(exchange, unit_of_work) ⇒ Address
constructor
A new instance of Address.
- #process(payload) ⇒ Object
Constructor Details
#initialize(exchange, unit_of_work) ⇒ Address
Returns a new instance of Address.
10 11 12 13 |
# File 'lib/letterbox/address.rb', line 10 def initialize(exchange, unit_of_work) @exchange = exchange @unit_of_work = unit_of_work end |
Instance Attribute Details
#exchange ⇒ Object (readonly)
Returns the value of attribute exchange.
8 9 10 |
# File 'lib/letterbox/address.rb', line 8 def exchange @exchange end |
#unit_of_work ⇒ Object (readonly)
Returns the value of attribute unit_of_work.
8 9 10 |
# File 'lib/letterbox/address.rb', line 8 def unit_of_work @unit_of_work end |
Instance Method Details
#process(payload) ⇒ Object
15 16 17 18 19 |
# File 'lib/letterbox/address.rb', line 15 def process(payload) unit_of_work.new(payload).perform exchange.async.completed_by(name) end |