Class: ProxyCheapClient::Balance
- Defined in:
- lib/proxy_cheap_client/models/balance.rb
Overview
module Models
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Balance
constructor
A new instance of Balance.
- #to_h ⇒ Object
Methods inherited from Base
#conn, extract_error_body, extract_error_message, parse_response, request, #request
Constructor Details
#initialize(attrs) ⇒ Balance
6 7 8 9 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 6 def initialize(attrs) @amount = attrs["balance"] || attrs["amount"] @currency = attrs["currency"] || "USD" end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
4 5 6 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 4 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
4 5 6 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 4 def currency @currency end |
Instance Method Details
#to_h ⇒ Object
11 12 13 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 11 def to_h { amount: amount, currency: currency } end |