Class: Rajasms::Client
Constant Summary collapse
- RAJASMS_URI =
'http://162.211.84.203'
- SMSREGULER_PATH =
'/sms/smsreguler.php'
- SMSMASKING_PATH =
'/sms/smsmasking.php'
- SMSSALDO_PATH =
'/sms/smssaldo.php'
- SMSREGULER_CHECK_PATH =
'/sms/smsregulerreport.php'
- SMSMASKING_CHECK_PATH =
'/sms/smsmaskingreport.php'
Instance Method Summary collapse
-
#initialize(username, password, api_key) ⇒ Client
constructor
A new instance of Client.
- #masking(to, message) ⇒ Object
- #reguler(to, message) ⇒ Object
- #saldo ⇒ Object
- #status(sms_id, reguler = false) ⇒ Object
Constructor Details
#initialize(username, password, api_key) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 |
# File 'lib/rajasms.rb', line 17 def initialize username, password, api_key @username = username @password = password @api_key = api_key end |
Instance Method Details
#masking(to, message) ⇒ Object
27 28 29 |
# File 'lib/rajasms.rb', line 27 def masking to, send(to, , SMSMASKING_PATH) end |
#reguler(to, message) ⇒ Object
23 24 25 |
# File 'lib/rajasms.rb', line 23 def reguler to, send(to, , SMSREGULER_PATH) end |
#saldo ⇒ Object
31 32 33 34 35 |
# File 'lib/rajasms.rb', line 31 def saldo response = self.class.get(SMSSALDO_PATH, build_query) code, data = response.body.split('|') {code: code, data: data} end |
#status(sms_id, reguler = false) ⇒ Object
37 38 39 40 41 |
# File 'lib/rajasms.rb', line 37 def status(sms_id, reguler=false) response = self.class.get(reguler ? SMSREGULER_CHECK_PATH : SMSMASKING_CHECK_PATH, build_query(id: sms_id)) code, data = response.body.split('|') {code: code, data: data} end |