Class: WaffleAPI::Payment
- Inherits:
-
Object
- Object
- WaffleAPI::Payment
- Defined in:
- lib/waffle_api/payment.rb
Overview
Payment object give access to recent payments from Wafflepool. It give access to amount, paid_at and transaction_hash
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#paid_at ⇒ Object
readonly
Returns the value of attribute paid_at.
-
#transaction_hash ⇒ Object
readonly
Returns the value of attribute transaction_hash.
Instance Method Summary collapse
-
#initialize(amount: 0.0, paid_at: Time.now.to_s, transaction_hash: '') ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(amount: 0.0, paid_at: Time.now.to_s, transaction_hash: '') ⇒ Payment
7 8 9 10 11 |
# File 'lib/waffle_api/payment.rb', line 7 def initialize(amount: 0.0, paid_at: Time.now.to_s, transaction_hash: '') @amount = amount @paid_at = DateTime.parse(paid_at).to_time @transaction_hash = transaction_hash end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
5 6 7 |
# File 'lib/waffle_api/payment.rb', line 5 def amount @amount end |
#paid_at ⇒ Object (readonly)
Returns the value of attribute paid_at.
5 6 7 |
# File 'lib/waffle_api/payment.rb', line 5 def paid_at @paid_at end |
#transaction_hash ⇒ Object (readonly)
Returns the value of attribute transaction_hash.
5 6 7 |
# File 'lib/waffle_api/payment.rb', line 5 def transaction_hash @transaction_hash end |