mo_sms 0.0.1 → 0.0.2
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/README.md +7 -6
- data/lib/mo_sms/sms_sender.rb +6 -6
- data/lib/mo_sms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59d96a45b307b5232c100dbcf4bfbe0291d09a48
|
4
|
+
data.tar.gz: 171cf60c36ce7630648e419c2781fc6a68b90582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1a13efe52b159151166dd995ccdc2e61a2794ba4e669ddfc36e0733c70965bb10091f6c7c2bcd75b555b1315e722f24d3525776cc2a3d2fb128b0605de7bf26
|
7
|
+
data.tar.gz: 97d4d0db0d52ef46ae80e1179b0ab43c9d52b5d84361730e67e22e7afa7b637ccabe3076579293584f2a6cb89087ec818ac531e5e3a5a517d62c99db9a7a1f98
|
data/README.md
CHANGED
@@ -26,16 +26,17 @@ To fire the class just
|
|
26
26
|
|
27
27
|
To send a text sms, call the .send() method. **Watch out for the Exceptions that can be thrown here :)**
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
sms.send("072123123", :text, "This is my message")
|
29
|
+
+ The first argument is the phone number to send the SMS to
|
30
|
+
+ The second one is the type of the message (Can be either :text or :wap)
|
31
|
+
+ The third argument is the content of the message
|
34
32
|
|
33
|
+
```
|
34
|
+
sms.send("072123123", :text, "This is my message")
|
35
|
+
```
|
35
36
|
|
36
37
|
Other attributes are added to the class (read the API specification) like...
|
37
38
|
|
38
39
|
sms.tariff = false #or true
|
39
|
-
sms.
|
40
|
+
sms.allow_long_message = false #or true
|
40
41
|
sms.custom_sender = false #or true
|
41
42
|
|
data/lib/mo_sms/sms_sender.rb
CHANGED
@@ -3,13 +3,13 @@ require "net/http"
|
|
3
3
|
|
4
4
|
module MoSms
|
5
5
|
class SMSSender
|
6
|
-
attr_accessor :username, :password, :tariff, :
|
6
|
+
attr_accessor :username, :password, :tariff, :allow_long_message, :custom_sender
|
7
7
|
|
8
8
|
def initialize(username, password)
|
9
9
|
@username = username
|
10
10
|
@password = password
|
11
11
|
@tariff = false
|
12
|
-
@
|
12
|
+
@allow_long_message = false
|
13
13
|
@custom_sender = false
|
14
14
|
end
|
15
15
|
|
@@ -35,14 +35,14 @@ module MoSms
|
|
35
35
|
private
|
36
36
|
def set_uri(phone_number, data, message_type)
|
37
37
|
tariff = ""
|
38
|
-
|
39
|
-
custom_sender
|
38
|
+
allow_long_message = ""
|
39
|
+
custom_sender = ""
|
40
40
|
|
41
41
|
tariff = "&tariff=1" if @tariff
|
42
|
-
|
42
|
+
allow_long_message = "&allowlong=1" if @allow_long_message
|
43
43
|
custom_sender = "&customsender=1" if @custom_sender
|
44
44
|
|
45
|
-
@api_uri = "http://www.mosms.com/se/sms-send.php?username=#{@username}&password=#{password}&nr=#{phone_number}&type=#{message_type}&data=#{data}#{tariff}#{
|
45
|
+
@api_uri = "http://www.mosms.com/se/sms-send.php?username=#{@username}&password=#{password}&nr=#{phone_number}&type=#{message_type}&data=#{data}#{tariff}#{allow_long_message}#{custom_sender}"
|
46
46
|
@api_uri = URI.escape(@api_uri)
|
47
47
|
end
|
48
48
|
|
data/lib/mo_sms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mo_sms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jone Samra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|