module Smslist::Client::Balance

Public Instance Methods

balance() click to toggle source

Get account balance

@return [Float] account balance @example Get balance for user qwerty

client = Smslist.new(login: 'qwerty', password: 'secret')
client.balance
# File lib/smslist/client/balance.rb, line 10
def balance
  response = parse_xml(post build_xml_body.to_xml, :balance)
  response.xpath('response/money').text.to_f
end
remaining_sms() click to toggle source

Get remaining sms count

@return [Integer] remaining sms count @example Get remaining sms count for user qwerty

client = Smslist.new(login: 'qwerty', password: 'secret')
client.remaining_sms
# File lib/smslist/client/balance.rb, line 21
def remaining_sms
  response = parse_xml(post build_xml_body.to_xml, :balance)
  response.xpath('response/sms').first.text.to_i
end