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

#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

#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

#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



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

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