Class: FreshdeskAPI::Configuration
- Inherits:
-
Object
- Object
- FreshdeskAPI::Configuration
- Defined in:
- lib/freshdesk_api/configuration.rb
Overview
Holds the configuration options for the client and connection
Instance Attribute Summary collapse
-
#allow_http ⇒ Boolean
Whether to allow non-HTTPS connections for development purposes.
-
#apitoken ⇒ String
The basic auth token.
-
#base_url ⇒ String
The API url.
-
#client_options ⇒ Hash
Client configurations.
-
#logger ⇒ Logger
Logger to use when logging requests.
-
#open_timeout ⇒ Object
:read_timeout and :open_timeout are how long to wait for a response and to open a connection, in seconds.
-
#password ⇒ String
The basic auth password.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#username ⇒ String
The basic auth username.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#options ⇒ Hash
Sets accept and user_agent headers, and url.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
32 33 34 |
# File 'lib/freshdesk_api/configuration.rb', line 32 def initialize = {} end |
Instance Attribute Details
#allow_http ⇒ Boolean
Returns Whether to allow non-HTTPS connections for development purposes.
25 26 27 |
# File 'lib/freshdesk_api/configuration.rb', line 25 def allow_http @allow_http end |
#apitoken ⇒ String
Returns The basic auth token.
13 14 15 |
# File 'lib/freshdesk_api/configuration.rb', line 13 def apitoken @apitoken end |
#base_url ⇒ String
Returns The API url. Must be https unless #allow_http is set.
16 17 18 |
# File 'lib/freshdesk_api/configuration.rb', line 16 def base_url @base_url end |
#client_options ⇒ Hash
Returns Client configurations.
22 23 24 |
# File 'lib/freshdesk_api/configuration.rb', line 22 def end |
#logger ⇒ Logger
Returns Logger to use when logging requests.
19 20 21 |
# File 'lib/freshdesk_api/configuration.rb', line 19 def logger @logger end |
#open_timeout ⇒ Object
:read_timeout and :open_timeout are how long to wait for a response and to open a connection, in seconds. Pass nil to disable the timeout.
29 30 31 |
# File 'lib/freshdesk_api/configuration.rb', line 29 def open_timeout @open_timeout end |
#password ⇒ String
Returns The basic auth password.
10 11 12 |
# File 'lib/freshdesk_api/configuration.rb', line 10 def password @password end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
30 31 32 |
# File 'lib/freshdesk_api/configuration.rb', line 30 def read_timeout @read_timeout end |
#username ⇒ String
Returns The basic auth username.
7 8 9 |
# File 'lib/freshdesk_api/configuration.rb', line 7 def username @username end |
Instance Method Details
#options ⇒ Hash
Sets accept and user_agent headers, and url
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/freshdesk_api/configuration.rb', line 39 def { headers: { accept: :json, content_type: :json, accept_encoding: 'gzip ,deflate', user_agent: "FreshdeskAPI API #{FreshdeskAPI::VERSION}" }, read_timeout: nil, open_timeout: nil, base_url: @base_url }.merge() end |