Class: Paymongo::Entities::PaymentMethod

Inherits:
BaseEntity
  • Object
show all
Defined in:
lib/paymongo/entities/payment_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_resource) ⇒ PaymentMethod

Returns a new instance of PaymentMethod.



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/paymongo/entities/payment_method.rb', line 14

def initialize(api_resource)
  @id = api_resource.id
  @billing = BillingEntity.new(api_resource.attributes['billing'])
  @details = api_resource.attributes['details']
  @livemode = api_resource.attributes['livemode']
  @metadata = api_resource.attributes['metadata']
  @source_id = api_resource.attributes['source_id']
  @type = api_resource.attributes['type']
  @created_at = api_resource.attributes['created_at']
  @updated_at = api_resource.attributes['updated_at']
end

Instance Attribute Details

#billingObject (readonly)

Returns the value of attribute billing.



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

def billing
  @billing
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#detailsObject (readonly)

Returns the value of attribute details.



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

def details
  @details
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#livemodeObject (readonly)

Returns the value of attribute livemode.



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

def livemode
  @livemode
end

#metadataObject (readonly)

Returns the value of attribute metadata.



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

def 
  @metadata
end

#source_idObject (readonly)

Returns the value of attribute source_id.



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

def source_id
  @source_id
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end