Class: PinPayment::Balance
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
Class Method Summary collapse
-
.current_balance ⇒ PinPayment::Balance
Uses the pin API to fetch your accounts balance.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Balance
constructor
A new instance of Balance.
Constructor Details
#initialize(options = {}) ⇒ Balance
Returns a new instance of Balance.
7 8 9 10 |
# File 'lib/pin_payment/balance.rb', line 7 def initialize = {} self.available = ["available"][0] self.pending = ["pending"][0] end |
Instance Attribute Details
#available ⇒ Object
Returns the value of attribute available.
4 5 6 |
# File 'lib/pin_payment/balance.rb', line 4 def available @available end |
#pending ⇒ Object
Returns the value of attribute pending.
4 5 6 |
# File 'lib/pin_payment/balance.rb', line 4 def pending @pending end |
Class Method Details
.current_balance ⇒ PinPayment::Balance
Uses the pin API to fetch your accounts balance.
15 16 17 18 |
# File 'lib/pin_payment/balance.rb', line 15 def self.current_balance response = get(URI.parse(PinPayment.api_url).tap{|uri| uri.path = '/1/balance' }, {}) new(response) end |