Class: Starling::Resources::CustomerResource

Inherits:
BaseResource show all
Defined in:
lib/starling/resources/customer_resource.rb

Overview

A resource representing the response returned from the Customer API

Instance Method Summary collapse

Methods inherited from BaseResource

#initialize

Constructor Details

This class inherits a constructor from Starling::Resources::BaseResource

Instance Method Details

#customer_uidString

Returns the Starling internal ID of the customer.

Returns:

  • (String)

    the Starling internal ID of the customer


6
7
8
# File 'lib/starling/resources/customer_resource.rb', line 6

def customer_uid
  parsed_data['customerUid']
end

#date_of_birthDate

Returns the date of birth of the customer.

Returns:

  • (Date)

    the date of birth of the customer


21
22
23
# File 'lib/starling/resources/customer_resource.rb', line 21

def date_of_birth
  present_date(parsed_data['dateOfBirth'])
end

#emailString

Returns the email address of the customer.

Returns:

  • (String)

    the email address of the customer


26
27
28
# File 'lib/starling/resources/customer_resource.rb', line 26

def email
  parsed_data['email']
end

#first_nameString

Returns the first name of the customer.

Returns:

  • (String)

    the first name of the customer


11
12
13
# File 'lib/starling/resources/customer_resource.rb', line 11

def first_name
  parsed_data['firstName']
end

#last_nameString

Returns the last name of the customer.

Returns:

  • (String)

    the last name of the customer


16
17
18
# File 'lib/starling/resources/customer_resource.rb', line 16

def last_name
  parsed_data['lastName']
end

#phoneString

Returns the phone number of the customer.

Returns:

  • (String)

    the phone number of the customer


31
32
33
# File 'lib/starling/resources/customer_resource.rb', line 31

def phone
  parsed_data['phone']
end