class GoCardless::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. Represents an instance of a event resource returned from the API
Attributes
action[R]
created_at[R]
details[R]
id[R]
metadata[R]
resource_type[R]
Public Class Methods
new(object)
click to toggle source
initialize a resource instance @param object [Hash] an object returned from the API
# File lib/gocardless-pro/resources/event.rb, line 32 def initialize(object) @object = object @action = object['action'] @created_at = object['created_at'] @details = object['details'] @id = object['id'] @links = object['links'] @metadata = object['metadata'] @resource_type = object['resource_type'] end
Public Instance Methods
links()
click to toggle source
return the links that the resource has
# File lib/gocardless-pro/resources/event.rb, line 45 def links Struct.new( *{ mandate: '', new_customer_bank_account: '', parent_event: '', payment: '', payout: '', previous_customer_bank_account: '', refund: '', subscription: '' }.keys.sort ).new(*@links.sort.map(&:last)) end
to_h()
click to toggle source
Provides the resource as a hash of all it’s readable attributes
# File lib/gocardless-pro/resources/event.rb, line 70 def to_h @object end