Class: GoCardlessPro::Resources::Event
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Event
- Defined in:
- lib/gocardless_pro/resources/event.rb
Overview
Events are stored for all webhooks. An event refers to a resource which has been updated, for example a payment which has been collected, or a mandate which has been transferred.
Defined Under Namespace
Classes: Links
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#customer_notifications ⇒ Object
readonly
Returns the value of attribute customer_notifications.
-
#details ⇒ Object
readonly
Returns the value of attribute details.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#resource_type ⇒ Object
readonly
Returns the value of attribute resource_type.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Event
constructor
Initialize a event resource instance.
-
#links ⇒ Object
Return the links that the resource has.
-
#to_h ⇒ Object
Provides the event resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Event
Initialize a event resource instance
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/gocardless_pro/resources/event.rb', line 29 def initialize(object, response = nil) @object = object @action = object['action'] @created_at = object['created_at'] @customer_notifications = object['customer_notifications'] @details = object['details'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @resource_type = object['resource_type'] @response = response end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
19 20 21 |
# File 'lib/gocardless_pro/resources/event.rb', line 19 def action @action end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
20 21 22 |
# File 'lib/gocardless_pro/resources/event.rb', line 20 def created_at @created_at end |
#customer_notifications ⇒ Object (readonly)
Returns the value of attribute customer_notifications.
21 22 23 |
# File 'lib/gocardless_pro/resources/event.rb', line 21 def customer_notifications @customer_notifications end |
#details ⇒ Object (readonly)
Returns the value of attribute details.
22 23 24 |
# File 'lib/gocardless_pro/resources/event.rb', line 22 def details @details end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23 24 25 |
# File 'lib/gocardless_pro/resources/event.rb', line 23 def id @id end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
24 25 26 |
# File 'lib/gocardless_pro/resources/event.rb', line 24 def @metadata end |
#resource_type ⇒ Object (readonly)
Returns the value of attribute resource_type.
25 26 27 |
# File 'lib/gocardless_pro/resources/event.rb', line 25 def resource_type @resource_type end |
Instance Method Details
#api_response ⇒ Object
43 44 45 |
# File 'lib/gocardless_pro/resources/event.rb', line 43 def api_response ApiResponse.new(@response) end |
#links ⇒ Object
Return the links that the resource has
48 49 50 |
# File 'lib/gocardless_pro/resources/event.rb', line 48 def links @event_links ||= Links.new(@links) end |
#to_h ⇒ Object
Provides the event resource as a hash of all its readable attributes
53 54 55 |
# File 'lib/gocardless_pro/resources/event.rb', line 53 def to_h @object end |