Class: Vortex::WebhookEvent
- Inherits:
-
Object
- Object
- Vortex::WebhookEvent
- Defined in:
- lib/vortex/webhook_types.rb
Overview
A Vortex webhook event representing a server-side state change
Instance Attribute Summary collapse
-
#account_id ⇒ String
readonly
The account ID.
-
#data ⇒ Hash
readonly
Event-specific payload data.
-
#environment_id ⇒ String?
readonly
The environment ID.
-
#id ⇒ String
readonly
Unique event ID.
-
#operation ⇒ String
readonly
The database operation.
-
#source_table ⇒ String
readonly
The source table.
-
#timestamp ⇒ String
readonly
ISO-8601 timestamp.
-
#type ⇒ String
readonly
The semantic event type.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ WebhookEvent
constructor
A new instance of WebhookEvent.
Constructor Details
#initialize(attrs) ⇒ WebhookEvent
Returns a new instance of WebhookEvent.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/vortex/webhook_types.rb', line 65 def initialize(attrs) @id = attrs['id'] @type = attrs['type'] = attrs['timestamp'] @account_id = attrs['accountId'] @environment_id = attrs['environmentId'] @source_table = attrs['sourceTable'] @operation = attrs['operation'] @data = attrs['data'] || {} end |
Instance Attribute Details
#account_id ⇒ String (readonly)
The account ID
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def account_id @account_id end |
#data ⇒ Hash (readonly)
Event-specific payload data
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def data @data end |
#environment_id ⇒ String? (readonly)
The environment ID
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def environment_id @environment_id end |
#id ⇒ String (readonly)
Unique event ID
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def id @id end |
#operation ⇒ String (readonly)
The database operation
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def operation @operation end |
#source_table ⇒ String (readonly)
The source table
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def source_table @source_table end |
#timestamp ⇒ String (readonly)
ISO-8601 timestamp
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def end |
#type ⇒ String (readonly)
The semantic event type
61 62 63 |
# File 'lib/vortex/webhook_types.rb', line 61 def type @type end |