Class: Axie::Account
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Class Method Summary collapse
Instance Method Summary collapse
- #get_slp_balance ⇒ Object
-
#initialize(data:, total:) ⇒ Account
constructor
A new instance of Account.
Methods inherited from Object
#method_missing, #respond_to_missing?
Constructor Details
#initialize(data:, total:) ⇒ Account
Returns a new instance of Account.
13 14 15 16 |
# File 'lib/axie/objects/account.rb', line 13 def initialize(data:, total:) @data = data @total = total end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Axie::Object
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/axie/objects/account.rb', line 3 def data @data end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/axie/objects/account.rb', line 3 def total @total end |
Class Method Details
.from_response(response) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/axie/objects/account.rb', line 5 def self.from_response(response) body = response.body new( data: body, total: body.dig("total") ) end |
Instance Method Details
#get_slp_balance ⇒ Object
18 19 20 |
# File 'lib/axie/objects/account.rb', line 18 def get_slp_balance total end |