Class: EventProcessors::EmployeePayrollDisbursementEventProcessor
- Inherits:
-
Object
- Object
- EventProcessors::EmployeePayrollDisbursementEventProcessor
- Defined in:
- app/notifications/event_processors/employee_payroll_disbursement_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:) ⇒ EmployeePayrollDisbursementEventProcessor
constructor
A new instance of EmployeePayrollDisbursementEventProcessor.
- #process ⇒ Object
Constructor Details
#initialize(reference_event:) ⇒ EmployeePayrollDisbursementEventProcessor
Returns a new instance of EmployeePayrollDisbursementEventProcessor.
5 6 7 |
# File 'app/notifications/event_processors/employee_payroll_disbursement_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/employee_payroll_disbursement_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 18 19 |
# File 'app/notifications/event_processors/employee_payroll_disbursement_event_processor.rb', line 9 def process transaction_header_id = reference_event.data['transaction_header_id'] transaction_header = PayrollTransactionHeader.find(transaction_header_id) employee = reference_event.reference EmployeePayrollDisbursementMailer.notification( transaction_header: transaction_header, employee: employee ).deliver_now end |