Class: AbacatePay::Webhooks::Event
- Inherits:
-
Object
- Object
- AbacatePay::Webhooks::Event
- Defined in:
- lib/abacate_pay/webhooks/event.rb
Overview
A parsed webhook event.
Accepts both the camelCase and snake_case spellings AbacatePay has used for the envelope fields, so older and newer webhook versions both parse.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
13 14 15 16 17 |
# File 'lib/abacate_pay/webhooks/event.rb', line 13 def initialize(data) @type = data["event"] || data["type"] @data = data["data"] @created_at = data["createdAt"] || data["created_at"] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/abacate_pay/webhooks/event.rb', line 10 def created_at @created_at end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/abacate_pay/webhooks/event.rb', line 10 def data @data end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
10 11 12 |
# File 'lib/abacate_pay/webhooks/event.rb', line 10 def type @type end |