nexmo-voice 0.1.0 → 0.1.1
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/nexmo/voice.rb +5 -1
- data/lib/nexmo/voice/version.rb +1 -1
- data/spec/nexmo/voice_spec.rb +3 -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: ae184c99ebe299cbd4292676ecf3cbd3abd3d26b
|
4
|
+
data.tar.gz: 21b45d35a87c5398f69bb85eef539bb2dd44079f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78ced49e4f68710e11f573f5e904d6c797acfe8c2d55a1c69286b73c9dedd36fad67176ae9cea0ab149198e3e0c87aeb37ffe4b1fe5e28ec66d97cc34fa388ec
|
7
|
+
data.tar.gz: 2487753de41f53f8813518e1a81b10af0da1324d6ab6ab4813ef623e004d0f3eb9a12d7271f3c86f4b2673ceacbaa137b6ba94d38a7ecedec8b097c29d652a2a
|
data/lib/nexmo/voice.rb
CHANGED
@@ -9,11 +9,15 @@ module Nexmo
|
|
9
9
|
BASE_URL = 'https://api.nexmo.com'
|
10
10
|
|
11
11
|
class Client
|
12
|
+
DEFAULT_TIMEOUT = 10
|
13
|
+
|
12
14
|
attr_accessor :nexmo_adaptor, :api_config,
|
13
15
|
:calls, :ttses
|
14
16
|
|
15
17
|
def initialize(api_key, api_secret, options = {})
|
16
|
-
@nexmo_adaptor = RestClient::Resource.new(BASE_URL,
|
18
|
+
@nexmo_adaptor = RestClient::Resource.new(BASE_URL,
|
19
|
+
timeout: options.fetch(:timeout) { DEFAULT_TIMEOUT },
|
20
|
+
open_timeout: options.fetch(:open_timeout) { DEFAULT_TIMEOUT })
|
17
21
|
|
18
22
|
@api_config = {
|
19
23
|
api_key: api_key,
|
data/lib/nexmo/voice/version.rb
CHANGED
data/spec/nexmo/voice_spec.rb
CHANGED
@@ -17,10 +17,12 @@ RSpec.describe Nexmo::Voice::Client do
|
|
17
17
|
|
18
18
|
it 'sets the default timeout' do
|
19
19
|
expect(client.nexmo_adaptor.timeout).to eq 10
|
20
|
+
expect(client.nexmo_adaptor.open_timeout).to eq 10
|
20
21
|
end
|
21
22
|
|
22
23
|
it 'sets the timeout' do
|
23
|
-
another_client = Nexmo::Voice::Client.new api_key, api_secret, timeout: 2
|
24
|
+
another_client = Nexmo::Voice::Client.new api_key, api_secret, timeout: 2, open_timeout: 1
|
24
25
|
expect(another_client.nexmo_adaptor.timeout).to eq 2
|
26
|
+
expect(another_client.nexmo_adaptor.open_timeout).to eq 1
|
25
27
|
end
|
26
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo-voice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fahchen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|