Class: WaffleAPI::Payment

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#amountObject (readonly)

Returns the value of attribute amount.



5
6
7
# File 'lib/waffle_api/payment.rb', line 5

def amount
  @amount
end

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_hashObject (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