Class: Retab::Configuration
- Inherits:
-
Object
- Object
- Retab::Configuration
- Defined in:
- lib/retab/configuration.rb
Constant Summary collapse
- DEFAULT_API_HOST =
'https://api.retab.com'
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize(api_key: nil, api_host: nil, timeout: nil, max_retries: nil, user_agent: nil) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(api_key: nil, api_host: nil, timeout: nil, max_retries: nil, user_agent: nil) ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 |
# File 'lib/retab/configuration.rb', line 14 def initialize(api_key: nil, api_host: nil, timeout: nil, max_retries: nil, user_agent: nil) @api_key = api_key @api_host = api_host || DEFAULT_API_HOST @timeout = timeout || 60 @max_retries = max_retries || 3 @user_agent = user_agent || "retab-ruby/#{Retab::VERSION rescue '0.1.0'}" end |
Instance Attribute Details
#api_host ⇒ Object
Returns the value of attribute api_host.
12 13 14 |
# File 'lib/retab/configuration.rb', line 12 def api_host @api_host end |
#api_key ⇒ Object
Returns the value of attribute api_key.
12 13 14 |
# File 'lib/retab/configuration.rb', line 12 def api_key @api_key end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
12 13 14 |
# File 'lib/retab/configuration.rb', line 12 def max_retries @max_retries end |
#timeout ⇒ Object
Returns the value of attribute timeout.
12 13 14 |
# File 'lib/retab/configuration.rb', line 12 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
12 13 14 |
# File 'lib/retab/configuration.rb', line 12 def user_agent @user_agent end |