tww 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -3
- data/lib/tww/client.rb +1 -1
- data/lib/tww/rest.rb +3 -3
- data/lib/tww/testing.rb +1 -1
- data/lib/tww/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: 3f8d42f8c0f5cd4deee9843234dfca2b0814337f
|
4
|
+
data.tar.gz: 945c7086ec1f0c48850e1bd4468229cc2e72122d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d271d55d68ab90224469b027bd6e88a5bfe6ea605c7026059b65fa73fbf874f244caebe0130a3c7965f63d763c7c1d913e51a3ff529e8b006e41f98f4f8eb85
|
7
|
+
data.tar.gz: e1edc2b1482976a31bdebadfc95b4d87f47a39451c01cdb81d2f00f6df528a8b8bf5b1c43bf02f3ce5ccedde2e77acc68b1a5f14d67ee57db409fcb812095377
|
data/README.md
CHANGED
@@ -31,18 +31,20 @@ TWW.config do |config|
|
|
31
31
|
config.username = 'you username goes here'
|
32
32
|
config.password= 'you password goes here'
|
33
33
|
config.from = 'Your identification (OPTIONAL)'
|
34
|
+
config.layout = 'Layout ID (JUST FOR VOICE MESSAGES)'
|
34
35
|
end
|
35
36
|
|
36
37
|
client = TWW.client
|
37
38
|
|
38
|
-
client.
|
39
|
+
client.deliver('11987654321', 'Hello World using old fashioned SMS')
|
39
40
|
client.call('11987654321', 'I just called to say I love you')
|
40
41
|
```
|
41
42
|
|
42
43
|
You can inspect TWW response:
|
44
|
+
|
43
45
|
```
|
44
46
|
# Previous setup
|
45
|
-
resp = client.
|
47
|
+
resp = client.deliver('11987654321', 'Hello World using old fashioned SMS')
|
46
48
|
|
47
49
|
case
|
48
50
|
when resp.ok?
|
@@ -56,6 +58,13 @@ when resp.error?
|
|
56
58
|
end
|
57
59
|
```
|
58
60
|
|
61
|
+
You can use obscure parameters from TWW API.
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
# Previous setup
|
65
|
+
client.call('11987654321', 'Var 1 value', var2: 'Var 2 value', retry: 3)
|
66
|
+
```
|
67
|
+
|
59
68
|
To fake SMS:
|
60
69
|
|
61
70
|
```ruby
|
@@ -67,7 +76,7 @@ TWW.enable_testing!
|
|
67
76
|
RSpec.describe 'TWW Testing' do
|
68
77
|
before
|
69
78
|
client = TWW.client
|
70
|
-
resp = client.
|
79
|
+
resp = client.deliver('11987654321', 'Hello World from TWW Gem')
|
71
80
|
end
|
72
81
|
|
73
82
|
it 'is not empty' do
|
data/lib/tww/client.rb
CHANGED
data/lib/tww/rest.rb
CHANGED
@@ -9,8 +9,8 @@ module TWW
|
|
9
9
|
CALL = 'http://webservices.fonadas.tww.com.br' +
|
10
10
|
'/ws/Fonadas.asmx/EnviaFonada'
|
11
11
|
|
12
|
-
def
|
13
|
-
request(SMS,
|
12
|
+
def deliver(phone, message, extras = {})
|
13
|
+
request(SMS, deliver_params(phone, message, extras))
|
14
14
|
end
|
15
15
|
|
16
16
|
def call(phone, message, extras = {})
|
@@ -39,7 +39,7 @@ module TWW
|
|
39
39
|
}.merge(extras)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
42
|
+
def deliver_params(phone, message, extras)
|
43
43
|
{
|
44
44
|
NumUsu: config.username,
|
45
45
|
Senha: config.password,
|
data/lib/tww/testing.rb
CHANGED
data/lib/tww/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tww
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Libanori
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|