Class: Bitso::Balance

Inherits:
Model
  • Object
show all
Defined in:
lib/bitso/balance.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#error, #message

Class Method Summary collapse

Methods inherited from Model

#attributes, #attributes=, #initialize

Constructor Details

This class inherits a constructor from Bitso::Model

Instance Attribute Details

#btc_availableObject

Returns the value of attribute btc_available.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def btc_available
  @btc_available
end

#btc_balanceObject

Returns the value of attribute btc_balance.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def btc_balance
  @btc_balance
end

#btc_reservedObject

Returns the value of attribute btc_reserved.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def btc_reserved
  @btc_reserved
end

#feeObject

Returns the value of attribute fee.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def fee
  @fee
end

#mxn_availableObject

Returns the value of attribute mxn_available.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def mxn_available
  @mxn_available
end

#mxn_balanceObject

Returns the value of attribute mxn_balance.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def mxn_balance
  @mxn_balance
end

#mxn_reservedObject

Returns the value of attribute mxn_reserved.



3
4
5
# File 'lib/bitso/balance.rb', line 3

def mxn_reserved
  @mxn_reserved
end

Class Method Details

.from_apiObject



5
6
7
# File 'lib/bitso/balance.rb', line 5

def self.from_api
  Bitso::Helper.parse_object!(Bitso::Net.post('/balance').to_str, self)
end

.method_missing(method, *args) ⇒ Object



9
10
11
12
13
14
# File 'lib/bitso/balance.rb', line 9

def self.method_missing method, *args
  balance = self.from_api
  return balance.send(method) if balance.respond_to? method

  super
end