Class: GoCardlessPro::Resources::TransferredMandate

Inherits:
Object
  • Object
show all
Defined in:
lib/gocardless_pro/resources/transferred_mandate.rb

Overview

Mandates that have been transferred using Current Account Switch Service

Defined Under Namespace

Classes: Links

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, response = nil) ⇒ TransferredMandate

Initialize a transferred_mandate resource instance

Parameters:

  • object (Hash)

    an object returned from the API



19
20
21
22
23
24
25
26
27
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 19

def initialize(object, response = nil)
  @object = object

  @encrypted_customer_bank_details = object['encrypted_customer_bank_details']
  @encrypted_decryption_key = object['encrypted_decryption_key']
  @links = object['links']
  @public_key_id = object['public_key_id']
  @response = response
end

Instance Attribute Details

#encrypted_customer_bank_detailsObject (readonly)

Returns the value of attribute encrypted_customer_bank_details.



15
16
17
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 15

def encrypted_customer_bank_details
  @encrypted_customer_bank_details
end

#encrypted_decryption_keyObject (readonly)

Returns the value of attribute encrypted_decryption_key.



15
16
17
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 15

def encrypted_decryption_key
  @encrypted_decryption_key
end

#public_key_idObject (readonly)

Returns the value of attribute public_key_id.



15
16
17
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 15

def public_key_id
  @public_key_id
end

Instance Method Details

#api_responseObject



29
30
31
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 29

def api_response
  ApiResponse.new(@response)
end

Return the links that the resource has



34
35
36
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 34

def links
  @transferred_mandate_links ||= Links.new(@links)
end

#to_hObject

Provides the transferred_mandate resource as a hash of all its readable attributes



39
40
41
# File 'lib/gocardless_pro/resources/transferred_mandate.rb', line 39

def to_h
  @object
end