zenvia-rb 0.0.8 → 0.0.9
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 +3 -2
- data/lib/zenvia/sms.rb +2 -0
- data/lib/zenvia/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: 2b57d17477ac2c94ed174414468a054dd146ddae
|
4
|
+
data.tar.gz: 438099b2cbcb471f75174668ba06736ab8f278d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b16adfd8a962691549daac09ebcb376d8fb3efd69e9dc414731f91142fa08588b6cf86bfd1a4291ae2cfdba706ea89f7da314ea2863eeae22433f893922a404
|
7
|
+
data.tar.gz: 65345c4268b62f355187ad9ed33c1d0ee0ece4b7ad2c319f3d9c8013afe20d05ecae229a1baa21a1b5daeea7c862b9876c0195dfa34d636ce63dd05fbf750ee5
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Add this line to your application's Gemfile:
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'zenvia-rb', '~> 0.0.
|
8
|
+
gem 'zenvia-rb', '~> 0.0.9'
|
9
9
|
```
|
10
10
|
|
11
11
|
And then execute:
|
@@ -33,7 +33,8 @@ Zenvia.configure {|config|
|
|
33
33
|
|
34
34
|
# from = personal or enterprise name. config.from is used as default.
|
35
35
|
# if you do not want to identify the sender, use from = ''
|
36
|
-
# number = area code + number / there's no need to put 55 before them
|
36
|
+
# number = area code + number / there's no need to put 55 before them
|
37
|
+
# AND format the number (i.e. remove parentheses, dashes...)
|
37
38
|
# message = body of the message
|
38
39
|
|
39
40
|
Zenvia.send_message(from = config.from, number, message)
|
data/lib/zenvia/sms.rb
CHANGED
@@ -33,6 +33,8 @@ module Zenvia
|
|
33
33
|
# convert number to string (if isn't yet) and insert the country code (standard: BR, 55)
|
34
34
|
# if not found
|
35
35
|
@number = @number.to_s unless @number.is_a? String
|
36
|
+
patterns = ['(', ')', ' ', '-']
|
37
|
+
patterns.each {|p| @number = @number.gsub(p, '')}
|
36
38
|
@number.insert(0, '55') unless /^55/.match(@number)
|
37
39
|
# retrieve auth value set in Config class
|
38
40
|
@auth = Zenvia.config.auth
|
data/lib/zenvia/version.rb
CHANGED