Class: ProxyCheapClient::Balance

Inherits:
Base
  • Object
show all
Defined in:
lib/proxy_cheap_client/models/balance.rb

Overview

module Models

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject (readonly)

Returns the value of attribute amount.



4
5
6
# File 'lib/proxy_cheap_client/models/balance.rb', line 4

def amount
  @amount
end

#connObject (readonly)

Returns the value of attribute conn.



4
5
6
# File 'lib/proxy_cheap_client/models/balance.rb', line 4

def conn
  @conn
end

#currencyObject (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_hObject



12
13
14
# File 'lib/proxy_cheap_client/models/balance.rb', line 12

def to_h
  { amount: amount, currency: currency }
end