Class: TransferTo::DSL

Inherits:
API show all
Defined in:
lib/transfer_to/dsl.rb

Instance Attribute Summary

Attributes inherited from Base

#reply, #request

Instance Method Summary collapse

Methods inherited from API

#check_wallet, #get_id_from_key, #msisdn_info, #ping, #pricelist, #reserve_id, #topup, #trans_info, #trans_list

Methods inherited from Base

#initialize, #run_action, #test_numbers

Constructor Details

This class inherits a constructor from TransferTo::Base

Instance Method Details

#check_statusObject

check the status of the TranferTo API



5
6
7
8
# File 'lib/transfer_to/dsl.rb', line 5

def check_status
  self.ping
  reply.success? && reply.message == "pong" && reply.auth_key == request.key
end

#phone_search(number, operator_id = nil) ⇒ Object

get information about a phone number



11
12
13
14
15
# File 'lib/transfer_to/dsl.rb', line 11

def phone_search(number, operator_id = nil)
  information = msisdn_info(number, operator_id).information
  information[:product_list] = information[:product_list].split(",")
  information
end