mfms 0.4.0 → 0.5.0
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/lib/mfms/sms.rb +8 -8
- data/lib/mfms/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: 1885c219afb77f43d4de0478714caea2aa62df46
|
4
|
+
data.tar.gz: 44e354b62416e7420c1684faa7e8612486d7aa7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 377f4c1501d3b0dc1588dea6737dea7bc2cd0480ba55e26542fb386e30ab5817d825381593da29adebb937085b935d16315bde48988e36c9ee7f180aa877c011
|
7
|
+
data.tar.gz: 87d326c331b441289a3f25616dd90ba4583e4c599c9c6cfc352ae90de98b17191f60b2e7eff9b9fab430372c78caaf68ce0344484175de38cdb1071557cb572d
|
data/lib/mfms/sms.rb
CHANGED
@@ -59,7 +59,7 @@ module Mfms
|
|
59
59
|
@id = body[2]
|
60
60
|
end
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
# => SMS delivery status codes:
|
64
64
|
# "enqueued" "Сообщение находится в очереди на отправку"
|
65
65
|
# "sent" "Сообщение отправлено"
|
@@ -90,6 +90,13 @@ module Mfms
|
|
90
90
|
@status = status
|
91
91
|
end
|
92
92
|
|
93
|
+
def validate!
|
94
|
+
raise ArgumentError, "Phone should be assigned to #{self.class}." if @phone.nil?
|
95
|
+
raise ArgumentError, "Phone number should contain only numbers. Minimum length is 10. #{@phone.inspect} is given." unless @phone =~ /^[0-9]{10,}$/
|
96
|
+
raise ArgumentError, "Subject should be assigned to #{self.class}." if @subject.nil?
|
97
|
+
raise ArgumentError, "Message should be assigned to #{self.class}." if @message.nil?
|
98
|
+
end
|
99
|
+
|
93
100
|
private
|
94
101
|
|
95
102
|
def self.establish_connection
|
@@ -100,13 +107,6 @@ module Mfms
|
|
100
107
|
http
|
101
108
|
end
|
102
109
|
|
103
|
-
def validate!
|
104
|
-
raise ArgumentError, "Phone should be assigned to #{self.class}." if @phone.nil?
|
105
|
-
raise ArgumentError, "Phone number should contain only numbers. Minimum length is 10. #{@phone.inspect} is given." unless @phone =~ /^[0-9]{10,}$/
|
106
|
-
raise ArgumentError, "Subject should be assigned to #{self.class}." if @subject.nil?
|
107
|
-
raise ArgumentError, "Message should be assigned to #{self.class}." if @message.nil?
|
108
|
-
end
|
109
|
-
|
110
110
|
def self.init_cert_store cert
|
111
111
|
raise ArgumentError, "Path to certificate should be defined for #{self}." if cert.nil?
|
112
112
|
raise ArgumentError, "Certificate file '#{File.expand_path(cert)}' does not exist." unless File.exist?(cert)
|
data/lib/mfms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mfms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fokin Eugene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-09-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: russian
|