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.
-
#conn ⇒ Object
readonly
Returns the value of attribute conn.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
-
#initialize(attrs = {}, client) ⇒ Balance
constructor
A new instance of Balance.
- #to_h ⇒ Object
Methods inherited from Base
#extract_error_body, #extract_error_message, #parse_response, #request
Constructor Details
#initialize(attrs = {}, client) ⇒ Balance
Returns a new instance of Balance.
6 7 8 9 10 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 6 def initialize(attrs = {}, client) @amount = attrs["balance"] || attrs["amount"] @currency = attrs["currency"] || "USD" @conn = client.conn 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 |
#conn ⇒ Object (readonly)
Returns the value of attribute conn.
4 5 6 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 4 def conn @conn 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
12 13 14 |
# File 'lib/proxy_cheap_client/models/balance.rb', line 12 def to_h { amount: amount, currency: currency } end |