tww 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c229b656d63517736b191911f58672c329b6500c
4
- data.tar.gz: a935eca2ba11c854232ae68ae6aa4e2a0c024c30
3
+ metadata.gz: 3f8d42f8c0f5cd4deee9843234dfca2b0814337f
4
+ data.tar.gz: 945c7086ec1f0c48850e1bd4468229cc2e72122d
5
5
  SHA512:
6
- metadata.gz: 1ab238c592a2ed3df9b526eff630dc289c5c1ec720bf04ae419e57c52401a8cdaeed91bf9fce495c8ccb3e9f6056e533fb052af1d472872f8e70022b9ad42af8
7
- data.tar.gz: 7522d847b8caecf8d6cf23e03a59c126ba77353774878d33d2978859a9269ca8dfd91129618285269949b2f0737ca3b7c0a462307388e09c21648198b9c0aeee
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.sms('11987654321', 'Hello World using old fashioned SMS')
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.sms('11987654321', 'Hello World using old fashioned SMS')
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.sms('11987654321', 'Hello World from TWW Gem')
79
+ resp = client.deliver('11987654321', 'Hello World from TWW Gem')
71
80
  end
72
81
 
73
82
  it 'is not empty' do
@@ -16,7 +16,7 @@ module TWW
16
16
  sent.size
17
17
  end
18
18
 
19
- def sms(phone, message, extras = {})
19
+ def deliver(phone, message, extras = {})
20
20
  raise 'Need to be implemented'
21
21
  end
22
22
 
@@ -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 sms(phone, message, extras = {})
13
- request(SMS, sms_params(phone, message, extras))
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 sms_params(phone, message, extras)
42
+ def deliver_params(phone, message, extras)
43
43
  {
44
44
  NumUsu: config.username,
45
45
  Senha: config.password,
@@ -2,7 +2,7 @@ require 'tww/client'
2
2
 
3
3
  module TWW
4
4
  class Testing < Client
5
- def sms(phone, message, extras = {})
5
+ def deliver(phone, message, extras = {})
6
6
  request(phone, message, extras)
7
7
  end
8
8
 
@@ -1,3 +1,3 @@
1
1
  module TWW
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
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.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-08 00:00:00.000000000 Z
11
+ date: 2016-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client