pjit-sms_api 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/sms_api.rb +6 -6
- data/lib/sms_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33b04a1835f14806e290e5a06c55c71ff4277077
|
4
|
+
data.tar.gz: 50c75389c9bb88c8363b7904f7c8508ad979c1a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb452910840c11c8af0b10135e19ea3b85bd39e4c763136eeb172423040de2ed297a4e6c429de1a24fb3dfcf1e5c1e5277c265d291a47dcec6f33fa454b08da8
|
7
|
+
data.tar.gz: 01feea9e5f1a52bedc3f7323f4aa710de61d1b383754c7dfcb230fd11ac631b788e848ca3e7bbda47e9842061894e7f21995cb1b3cee8bb0e61daeb0a11d2ded
|
data/.gitignore
CHANGED
data/lib/sms_api.rb
CHANGED
@@ -3,8 +3,6 @@ require 'httparty'
|
|
3
3
|
|
4
4
|
##
|
5
5
|
# TODO
|
6
|
-
# DOTO
|
7
|
-
# dubidubidu
|
8
6
|
module SmsApi
|
9
7
|
include HTTParty
|
10
8
|
base_uri 'https://api.smsapi.pl'
|
@@ -14,16 +12,18 @@ module SmsApi
|
|
14
12
|
format :json
|
15
13
|
|
16
14
|
##
|
17
|
-
# Method to send
|
18
|
-
#
|
15
|
+
# Method to send SMS
|
16
|
+
# For 'Eco' messages you should pass only msisdn and message
|
17
|
+
# For Pro message you should set third argument 'from'
|
18
|
+
# usage: SmsApi.sms('MSISDN','message', 'from')
|
19
19
|
# Some details about response
|
20
20
|
# In response you will recive ['count'] of sended messages,
|
21
21
|
# "list" of messages, on list you have some extra data:
|
22
22
|
# "id" - message id, You can use it to grab message status,
|
23
23
|
# "points" - cost of operation, "error" - error code if will ocure
|
24
|
-
def self.sms(to, text)
|
24
|
+
def self.sms(to, text, from = 'Eco')
|
25
25
|
test = ENV['SMSAPI_TEST'] || 0
|
26
|
-
get('/sms.do', query: { to: to, test: test, message: text })
|
26
|
+
get('/sms.do', query: { to: to, test: test, message: text, from: from })
|
27
27
|
end
|
28
28
|
|
29
29
|
##
|
data/lib/sms_api/version.rb
CHANGED