Class: EventProcessors::InvoiceSentViaEdiEventProcessor
- Inherits:
-
Object
- Object
- EventProcessors::InvoiceSentViaEdiEventProcessor
- Defined in:
- app/notifications/event_processors/invoice_sent_via_edi_event_processor.rb
Instance Attribute Summary collapse
-
#reference_event ⇒ Object
readonly
Returns the value of attribute reference_event.
Instance Method Summary collapse
-
#initialize(reference_event:) ⇒ InvoiceSentViaEdiEventProcessor
constructor
A new instance of InvoiceSentViaEdiEventProcessor.
- #process ⇒ Object
Constructor Details
#initialize(reference_event:) ⇒ InvoiceSentViaEdiEventProcessor
Returns a new instance of InvoiceSentViaEdiEventProcessor.
5 6 7 |
# File 'app/notifications/event_processors/invoice_sent_via_edi_event_processor.rb', line 5 def initialize(reference_event:) @reference_event = reference_event end |
Instance Attribute Details
#reference_event ⇒ Object (readonly)
Returns the value of attribute reference_event.
3 4 5 |
# File 'app/notifications/event_processors/invoice_sent_via_edi_event_processor.rb', line 3 def reference_event @reference_event end |
Instance Method Details
#process ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/notifications/event_processors/invoice_sent_via_edi_event_processor.rb', line 9 def process edi_invoice = EdiInvoice.find(reference_event.reference_id) edi_partner = EdiPartner.find(reference_event.data['edi_partner_id']) InvoiceSentViaEdiMailer.notification( edi_invoice: edi_invoice, edi_partner: edi_partner ).deliver_now end |