Class: IqSMS::Response::Balance

Inherits:
IqSMS::Response show all
Defined in:
lib/iqsms/response/balance.rb

Instance Attribute Summary

Attributes inherited from IqSMS::Response

#hash, #original_response, #status

Instance Method Summary collapse

Methods inherited from IqSMS::Response

#initialize

Constructor Details

This class inherits a constructor from IqSMS::Response

Instance Method Details

#balanceObject



8
9
10
11
# File 'lib/iqsms/response/balance.rb', line 8

def balance
  @balance ||= balance_hash[:balance].to_s.to_d
  @balance
end

#balance_hashObject



4
5
6
# File 'lib/iqsms/response/balance.rb', line 4

def balance_hash
  @hash[:balance].first
end

#creditObject



17
18
19
20
# File 'lib/iqsms/response/balance.rb', line 17

def credit
  @credit ||= balance_hash[:credit].to_s.to_d
  @credit
end

#currencyObject



13
14
15
# File 'lib/iqsms/response/balance.rb', line 13

def currency
  balance_hash[:type]
end