Class: BudaApi::Models::Balance

Inherits:
BaseModel show all
Defined in:
lib/buda_api/models.rb

Overview

Balance model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#raw, #to_h, #to_json

Constructor Details

#initialize(data) ⇒ Balance

Returns a new instance of Balance.



185
186
187
188
189
190
191
192
193
# File 'lib/buda_api/models.rb', line 185

def initialize(data)
  super(data)
  @id = data["id"] 
  @account_id = data["account_id"]
  @amount = parse_amount(data["amount"])
  @available_amount = parse_amount(data["available_amount"])
  @frozen_amount = parse_amount(data["frozen_amount"])
  @pending_withdraw_amount = parse_amount(data["pending_withdraw_amount"])
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def 
  @account_id
end

#amountObject (readonly)

Returns the value of attribute amount.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def amount
  @amount
end

#available_amountObject (readonly)

Returns the value of attribute available_amount.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def available_amount
  @available_amount
end

#frozen_amountObject (readonly)

Returns the value of attribute frozen_amount.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def frozen_amount
  @frozen_amount
end

#idObject (readonly)

Returns the value of attribute id.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def id
  @id
end

#pending_withdraw_amountObject (readonly)

Returns the value of attribute pending_withdraw_amount.



195
196
197
# File 'lib/buda_api/models.rb', line 195

def pending_withdraw_amount
  @pending_withdraw_amount
end

Instance Method Details

#currencyObject



198
199
200
# File 'lib/buda_api/models.rb', line 198

def currency
  @amount&.currency
end