Class: Letterbox::Address

Inherits:
Object
  • Object
show all
Includes:
Celluloid
Defined in:
lib/letterbox/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#exchangeObject (readonly)

Returns the value of attribute exchange.



8
9
10
# File 'lib/letterbox/address.rb', line 8

def exchange
  @exchange
end

#unit_of_workObject (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