Class: DuffelAPI::Resources::Payment

Inherits:
BaseResource show all
Defined in:
lib/duffel_api/resources/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResource

#api_response

Constructor Details

#initialize(object, response = nil) ⇒ Payment

Returns a new instance of Payment.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/duffel_api/resources/payment.rb', line 13

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

  @amount = object["amount"]
  @created_at = object["created_at"]
  @currency = object["currency"]
  @id = object["id"]
  @type = object["type"]

  super(object, response)
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



7
8
9
# File 'lib/duffel_api/resources/payment.rb', line 7

def amount
  @amount
end

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/duffel_api/resources/payment.rb', line 8

def created_at
  @created_at
end

#currencyObject (readonly)

Returns the value of attribute currency.



9
10
11
# File 'lib/duffel_api/resources/payment.rb', line 9

def currency
  @currency
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/duffel_api/resources/payment.rb', line 10

def id
  @id
end

#typeObject (readonly)

Returns the value of attribute type.



11
12
13
# File 'lib/duffel_api/resources/payment.rb', line 11

def type
  @type
end