coolsms-client 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/coolsms/client.rb +7 -1
- data/lib/coolsms/client/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: a4d69ab619be656f96f12505c01e34df5bf8a9e8
|
4
|
+
data.tar.gz: a41fa018ba83eaeb2505122ff78d9907ddef55d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22751d6b462bfd74c6950c6bed12e69f697894e004fdd7e3a2a3e5e766114b9abc359f995017fb4a8fbb1fc1e0e3a7999a579f70d2b83624155774f246d7a639
|
7
|
+
data.tar.gz: 78eb0e314ede3a7b3437851bc5467817ed0330f5a3a0c8d395eba7e51777c7e322678a24cc9e9f1fc5e45c56e968b64e90b42be04c62ba5a415fb35cd4340d3c
|
data/README.md
CHANGED
data/lib/coolsms/client.rb
CHANGED
@@ -25,7 +25,13 @@ module Coolsms
|
|
25
25
|
slt = salt
|
26
26
|
signature = signature(ts,slt)
|
27
27
|
type = options[:text].bytesize > 80 ? 'LMS' : 'SMS'
|
28
|
-
|
28
|
+
body = { :api_key => @api_key, :type => type, :salt => slt, :signature => signature, :to => options[:to], :timestamp => ts, :from => @sender, :text => options[:text] }
|
29
|
+
|
30
|
+
if type == 'LMS'
|
31
|
+
body.merge! :subject => options[:subject] ? options[:subject] : ""
|
32
|
+
end
|
33
|
+
|
34
|
+
res = HTTParty.post(COOLSMS_URL, :headers => { 'Content-Type' => 'application/x-www-form-urlencoded' }, :body => body)
|
29
35
|
parse_response res
|
30
36
|
end
|
31
37
|
|