Class: BudaApi::Models::Balance
- Defined in:
- lib/buda_api/models.rb
Overview
Balance model
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#available_amount ⇒ Object
readonly
Returns the value of attribute available_amount.
-
#frozen_amount ⇒ Object
readonly
Returns the value of attribute frozen_amount.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pending_withdraw_amount ⇒ Object
readonly
Returns the value of attribute pending_withdraw_amount.
Instance Method Summary collapse
- #currency ⇒ Object
-
#initialize(data) ⇒ Balance
constructor
A new instance of Balance.
Methods inherited from BaseModel
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_id ⇒ Object (readonly)
Returns the value of attribute account_id.
195 196 197 |
# File 'lib/buda_api/models.rb', line 195 def account_id @account_id end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
195 196 197 |
# File 'lib/buda_api/models.rb', line 195 def amount @amount end |
#available_amount ⇒ Object (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_amount ⇒ Object (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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
195 196 197 |
# File 'lib/buda_api/models.rb', line 195 def id @id end |
#pending_withdraw_amount ⇒ Object (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
#currency ⇒ Object
198 199 200 |
# File 'lib/buda_api/models.rb', line 198 def currency @amount&.currency end |