Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #78 from HelloFax/binti-family-read-timeout-option
Browse files Browse the repository at this point in the history
Binti family read timeout option
  • Loading branch information
jyoung488 committed Feb 13, 2018
2 parents 010d396 + e97d9a2 commit 0ba98fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/hello_sign/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Client
include Api::OAuth
include Api::ApiApp

attr_accessor :end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :logging, :log_level, :proxy_uri, :proxy_user, :proxy_pass
attr_accessor :end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :logging, :log_level, :proxy_uri, :proxy_user, :proxy_pass, :timeout

ERRORS = {
400 => Error::BadRequest,
Expand Down Expand Up @@ -154,6 +154,7 @@ def make_connection options
faraday.request :url_encoded
faraday.response :logger, logger if @logging
faraday.adapter :net_http
faraday.options[:timeout] = timeout if timeout
end
if options[:no_auth]
elsif auth_token
Expand Down
3 changes: 2 additions & 1 deletion lib/hello_sign/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module Configuration
DEFAULT_ENDPOINT = 'https://api.hellosign.com'
DEFAULT_API_VERSION = '/v3'
DEFAULT_OAUTH_ENDPOINT = 'https://app.hellosign.com'
VALID_OPTIONS_KEYS = [:end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :log_level, :logging, :proxy_uri, :proxy_user, :proxy_pass]
VALID_OPTIONS_KEYS = [:end_point, :oauth_end_point, :api_version, :user_agent, :client_id, :client_secret, :email_address, :password, :api_key, :auth_token, :log_level, :logging, :proxy_uri, :proxy_user, :proxy_pass, :timeout]


DEFAULT_USER_AGENT = "hellosign-ruby-sdk/" + HelloSign::VERSION
Expand Down Expand Up @@ -77,6 +77,7 @@ def reset
self.proxy_uri = nil
self.proxy_user = nil
self.proxy_pass = nil
self.timeout = nil
end
end
end
2 changes: 1 addition & 1 deletion lib/hello_sign/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
#

module HelloSign
VERSION = '3.6'
VERSION = '3.6.1'
end
11 changes: 10 additions & 1 deletion spec/hello_sign/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
:logging => false,
:proxy_uri => 'proxy_uri',
:proxy_user => 'proxy_user',
:proxy_pass => 'proxy_pass'
:proxy_pass => 'proxy_pass',
:timeout => 240
}
}
subject(:client) { HelloSign::Client.new custom_client }
Expand All @@ -37,6 +38,14 @@
expect(client.send(key)).to eql(custom_client[key])
end
end

it "should create a new HelloSign Client" do
expect(client).to be_an_instance_of(HelloSign::Client)
end

it "should have 'timeout' as a parameter" do
expect(client.timeout).to eq(240)
end
end
end

Expand Down

0 comments on commit 0ba98fe

Please sign in to comment.