Class: Fuik::Event
- Inherits:
-
Object
- Object
- Fuik::Event
- Defined in:
- app/models/fuik/event.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(webhook_event) ⇒ Event
constructor
A new instance of Event.
-
#payload ⇒ Fuik::DotAccess::AccessPayload
Access the webhook payload with dot notation or standard hash access.
-
#process! ⇒ void
Called when the webhook event is processed.
Constructor Details
#initialize(webhook_event) ⇒ Event
Returns a new instance of Event.
20 21 22 |
# File 'app/models/fuik/event.rb', line 20 def initialize(webhook_event) @webhook_event = webhook_event end |
Class Method Details
.event_id(key = nil, **options) ⇒ Object
15 16 17 |
# File 'app/models/fuik/event.rb', line 15 def event_id(key = nil, **) self.event_id_config = key || end |
.event_type(key = nil, **options) ⇒ Object
11 12 13 |
# File 'app/models/fuik/event.rb', line 11 def event_type(key = nil, **) self.event_type_config = key || end |
Instance Method Details
#payload ⇒ Fuik::DotAccess::AccessPayload
Access the webhook payload with dot notation or standard hash access.
51 52 53 |
# File 'app/models/fuik/event.rb', line 51 def payload @webhook_event.payload.to_dot end |
#process! ⇒ void
This method returns an undefined value.
Called when the webhook event is processed. Override to handle the event payload and transition the event's status to processed or failed.
38 39 40 |
# File 'app/models/fuik/event.rb', line 38 def process! raise NotImplementedError, "#{self.class} must implement #process!" end |