class PinPayment::Balance
Attributes
available[RW]
pending[RW]
Public Class Methods
current_balance()
click to toggle source
Uses the pin API to fetch your accounts balance.
@return [PinPayment::Balance]
# 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
new(options = {})
click to toggle source
# File lib/pin_payment/balance.rb, line 7 def initialize options = {} self.available = options["available"][0] self.pending = options["pending"][0] end
Private Class Methods
attributes()
click to toggle source
# File lib/pin_payment/balance.rb, line 22 def self.attributes [:available, :pending] end