class GoCardlessPro::Resources::Event
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. See [here](event-actions) for a complete list of event types.
Attributes
action[R]
created_at[R]
customer_notifications[R]
details[R]
id[R]
metadata[R]
resource_type[R]
Public Class Methods
new(object, response = nil)
click to toggle source
Initialize a event resource instance @param object [Hash] an object returned from the API
# File lib/gocardless_pro/resources/event.rb, line 30 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
Public Instance Methods
api_response()
click to toggle source
# File lib/gocardless_pro/resources/event.rb, line 44 def api_response ApiResponse.new(@response) end
links()
click to toggle source
Return the links that the resource has
# File lib/gocardless_pro/resources/event.rb, line 49 def links @event_links ||= Links.new(@links) end
to_h()
click to toggle source
Provides the event resource as a hash of all its readable attributes
# File lib/gocardless_pro/resources/event.rb, line 54 def to_h @object end