Class: GoCardlessPro::Resources::Customer
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::Customer
- Defined in:
- lib/gocardless_pro/resources/customer.rb
Overview
Customer objects hold the contact details for a customer. A customer can have several [customer bank accounts](#core-endpoints-customer-bank-accounts), which in turn can have several Direct Debit [mandates](#core-endpoints-mandates).
Instance Attribute Summary collapse
-
#address_line1 ⇒ Object
readonly
Returns the value of attribute address_line1.
-
#address_line2 ⇒ Object
readonly
Returns the value of attribute address_line2.
-
#address_line3 ⇒ Object
readonly
Returns the value of attribute address_line3.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#company_name ⇒ Object
readonly
Returns the value of attribute company_name.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#danish_identity_number ⇒ Object
readonly
Returns the value of attribute danish_identity_number.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#family_name ⇒ Object
readonly
Returns the value of attribute family_name.
-
#given_name ⇒ Object
readonly
Returns the value of attribute given_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#language ⇒ Object
readonly
Returns the value of attribute language.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#swedish_identity_number ⇒ Object
readonly
Returns the value of attribute swedish_identity_number.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ Customer
constructor
Initialize a customer resource instance.
-
#to_h ⇒ Object
Provides the customer resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ Customer
Initialize a customer resource instance
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/gocardless_pro/resources/customer.rb', line 23 def initialize(object, response = nil) @object = object @address_line1 = object['address_line1'] @address_line2 = object['address_line2'] @address_line3 = object['address_line3'] @city = object['city'] @company_name = object['company_name'] @country_code = object['country_code'] @created_at = object['created_at'] @danish_identity_number = object['danish_identity_number'] @email = object['email'] @family_name = object['family_name'] @given_name = object['given_name'] @id = object['id'] @language = object['language'] @metadata = object['metadata'] @phone_number = object['phone_number'] @postal_code = object['postal_code'] @region = object['region'] @swedish_identity_number = object['swedish_identity_number'] @response = response end |
Instance Attribute Details
#address_line1 ⇒ Object (readonly)
Returns the value of attribute address_line1.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def address_line1 @address_line1 end |
#address_line2 ⇒ Object (readonly)
Returns the value of attribute address_line2.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def address_line2 @address_line2 end |
#address_line3 ⇒ Object (readonly)
Returns the value of attribute address_line3.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def address_line3 @address_line3 end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def city @city end |
#company_name ⇒ Object (readonly)
Returns the value of attribute company_name.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def company_name @company_name end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def country_code @country_code end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def created_at @created_at end |
#danish_identity_number ⇒ Object (readonly)
Returns the value of attribute danish_identity_number.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def danish_identity_number @danish_identity_number end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def email @email end |
#family_name ⇒ Object (readonly)
Returns the value of attribute family_name.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def family_name @family_name end |
#given_name ⇒ Object (readonly)
Returns the value of attribute given_name.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def given_name @given_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def id @id end |
#language ⇒ Object (readonly)
Returns the value of attribute language.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def language @language end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def @metadata end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def phone_number @phone_number end |
#postal_code ⇒ Object (readonly)
Returns the value of attribute postal_code.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def postal_code @postal_code end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def region @region end |
#swedish_identity_number ⇒ Object (readonly)
Returns the value of attribute swedish_identity_number.
18 19 20 |
# File 'lib/gocardless_pro/resources/customer.rb', line 18 def swedish_identity_number @swedish_identity_number end |
Instance Method Details
#api_response ⇒ Object
47 48 49 |
# File 'lib/gocardless_pro/resources/customer.rb', line 47 def api_response ApiResponse.new(@response) end |
#to_h ⇒ Object
Provides the customer resource as a hash of all its readable attributes
52 53 54 |
# File 'lib/gocardless_pro/resources/customer.rb', line 52 def to_h @object end |