tww 0.3.1 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c29b158cd83fefc1c85d76e38480d38552524c9e
4
- data.tar.gz: bc03c8bdd07aecfdb5971d6991adb932b4c74939
3
+ metadata.gz: 59c8c99e1eb3d3a0fc42449db0b84a8aa7d2aef2
4
+ data.tar.gz: ea0314a02f6e28f1b824ef2a9293aaccea6214e8
5
5
  SHA512:
6
- metadata.gz: 210047da7367738deeda81660bf4b96ecbfb3716df5146bf8cf8c81ef69a16ef6e5055deb4bd0fbd9f651d441ad8fdbf519c6106add29a7f4ad9936e50ffc1a9
7
- data.tar.gz: 351f3453e38c4f73ed39607ccf4b663c5f4f1b7be0017ed88a15c7f4e5f78ef18264a5b4401a45bba346de1d994d893ff1be24d3a9e4dce03f96d3aa8b9cef38
6
+ metadata.gz: 0d41e585ec0d1c5f812868d3c81c032bda2c4a5f4a4006054cddb77a2f049e1663cf6e49ebc00c5cd7c3a3f46784fe67d1cc70f6899ab1941d92d76ae1283f63
7
+ data.tar.gz: b819ce7be98649e6b39e51aa4d133995db6225f2302ac184b7a987e21163d978ab5364435a287f280f9bee775bafc11ada8ef4f7ac5bf9edbd98acc9148aedba
data/lib/tww.rb CHANGED
@@ -12,16 +12,22 @@ module TWW
12
12
  end
13
13
 
14
14
  def client
15
- @factory.new.tap { |client| client.config = config }
15
+ @client ||= @factory.new
16
16
  end
17
17
 
18
18
  def enable_testing!
19
+ reset_client
19
20
  @factory = TWW::Testing
20
21
  end
21
22
 
22
23
  def disable_testing!
24
+ reset_client
23
25
  @factory = TWW::REST
24
26
  end
27
+
28
+ def reset_client
29
+ @client = nil
30
+ end
25
31
  end
26
32
 
27
33
  disable_testing!
@@ -2,10 +2,10 @@ require 'tww/response'
2
2
 
3
3
  module TWW
4
4
  class Client
5
- attr_accessor :config, :sent
5
+ attr_reader :config, :sent
6
6
 
7
7
  def initialize
8
- @sent = []
8
+ @config, @sent = TWW.config, []
9
9
  end
10
10
 
11
11
  def deliver(phone, message)
@@ -1,3 +1,3 @@
1
1
  module TWW
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tww
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Libanori