Class: Paymongo::Entities::Customer

Inherits:
BaseEntity show all
Defined in:
lib/paymongo/entities/customer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_resource) ⇒ Customer

Returns a new instance of Customer.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/paymongo/entities/customer.rb', line 17

def initialize(api_resource)
  @id = api_resource.id
  @default_device = api_resource.attributes['default_device']
  @default_payment_method_id = api_resource.attributes['default_payment_method_id']
  @deleted = api_resource.attributes['deleted']
  @email = api_resource.attributes['email']
  @first_name = api_resource.attributes['first_name']
  @last_name = api_resource.attributes['last_name']
  @livemode = api_resource.attributes['livemode']
  @phone = api_resource.attributes['phone']
  @type = api_resource.data['type']
  @created_at = api_resource.attributes['created_at']
  @updated_at = api_resource.attributes['updated_at']
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def created_at
  @created_at
end

#default_deviceObject (readonly)

Returns the value of attribute default_device.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def default_device
  @default_device
end

#default_payment_method_idObject (readonly)

Returns the value of attribute default_payment_method_id.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def default_payment_method_id
  @default_payment_method_id
end

#deletedObject (readonly)

Returns the value of attribute deleted.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def deleted
  @deleted
end

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def email
  @email
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def first_name
  @first_name
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def id
  @id
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def last_name
  @last_name
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def livemode
  @livemode
end

#phoneObject (readonly)

Returns the value of attribute phone.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def phone
  @phone
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def type
  @type
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



4
5
6
# File 'lib/paymongo/entities/customer.rb', line 4

def updated_at
  @updated_at
end