Class: BunqRb::Payment
- Inherits:
-
Object
- Object
- BunqRb::Payment
- Includes:
- Shared
- Defined in:
- lib/bunq_rb/objects/payment.rb
Overview
Payment
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#created ⇒ Object
readonly
Returns the value of attribute created.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hsh = {}) ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(hsh = {}) ⇒ Payment
Returns a new instance of Payment.
10 11 12 13 14 15 16 |
# File 'lib/bunq_rb/objects/payment.rb', line 10 def initialize(hsh = {}) @id = hsh["id"] @description = hsh["description"] @amount = Money.new(hsh["amount"]["value"].to_f * 100, hsh["amount"]["currency"]) @created = Time.parse(hsh["created"]) @updated = Time.parse(hsh["updated"]) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/bunq_rb/objects/payment.rb', line 8 def amount @amount end |
#created ⇒ Object (readonly)
Returns the value of attribute created.
8 9 10 |
# File 'lib/bunq_rb/objects/payment.rb', line 8 def created @created end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/bunq_rb/objects/payment.rb', line 8 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/bunq_rb/objects/payment.rb', line 8 def id @id end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
8 9 10 |
# File 'lib/bunq_rb/objects/payment.rb', line 8 def updated @updated end |
Class Method Details
.url(user_id, monetary_account_id) ⇒ Object
18 19 20 |
# File 'lib/bunq_rb/objects/payment.rb', line 18 def self.url(user_id, monetary_account_id) "/v1/user/#{user_id}/monetary-account/#{monetary_account_id}/payment" end |