Class: GeminiApi::Balance

Inherits:
Struct
  • Object
show all
Defined in:
lib/gemini_api/balance.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#amountObject

Returns the value of attribute amount

Returns:

  • (Object)

    the current value of amount



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def amount
  @amount
end

#availableObject

Returns the value of attribute available

Returns:

  • (Object)

    the current value of available



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def available
  @available
end

#available_for_withdrawalObject

Returns the value of attribute available_for_withdrawal

Returns:

  • (Object)

    the current value of available_for_withdrawal



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def available_for_withdrawal
  @available_for_withdrawal
end

#currencyObject

Returns the value of attribute currency

Returns:

  • (Object)

    the current value of currency



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def currency
  @currency
end

#raw_dataObject

Returns the value of attribute raw_data

Returns:

  • (Object)

    the current value of raw_data



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def raw_data
  @raw_data
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



4
5
6
# File 'lib/gemini_api/balance.rb', line 4

def type
  @type
end

Class Method Details

.build(raw_data) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/gemini_api/balance.rb', line 13

def self.build(raw_data)
  new(
    type: raw_data['type'],
    currency: raw_data['currency'],
    amount: BigDecimal(raw_data['amount']),
    available: BigDecimal(raw_data['available']),
    available_for_withdrawal: BigDecimal(raw_data['availableForWithdrawal']),
    raw_data: raw_data
  )
end