Class: Forem::Configuration
- Inherits:
-
Object
- Object
- Forem::Configuration
- Defined in:
- lib/forem/configuration.rb
Overview
Holds all configuration settings for the Forem API client.
Instances are typically created and mutated through configure.
Instance Attribute Summary collapse
-
#api_base ⇒ Object
Returns the value of attribute api_base.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Logger?
A custom Logger instance to receive debug output.
-
#max_network_retries ⇒ Object
Returns the value of attribute max_network_retries.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Create a new Configuration with default values.
-
#initialize_dup(source) ⇒ void
Support duplicating a configuration via
dup.
Constructor Details
#initialize ⇒ Configuration
Create a new Configuration with default values.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/forem/configuration.rb', line 55 def initialize @api_key = nil @api_base = "https://dev.to" @api_version = "v1" @open_timeout = 30 @read_timeout = 80 @max_network_retries = 1 @log_level = nil @logger = nil end |
Instance Attribute Details
#api_base ⇒ Object
Returns the value of attribute api_base.
|
|
# File 'lib/forem/configuration.rb', line 18
|
#api_key ⇒ Object
Returns the value of attribute api_key.
|
|
# File 'lib/forem/configuration.rb', line 13
|
#api_version ⇒ Object
Returns the value of attribute api_version.
|
|
# File 'lib/forem/configuration.rb', line 22
|
#log_level ⇒ Object
Returns the value of attribute log_level.
|
|
# File 'lib/forem/configuration.rb', line 40
|
#logger ⇒ Logger?
Returns a custom Logger instance to receive debug output.
Defaults to nil.
48 49 |
# File 'lib/forem/configuration.rb', line 48 attr_accessor :api_key, :api_base, :api_version, :open_timeout, :read_timeout, :max_network_retries, :log_level, :logger |
#max_network_retries ⇒ Object
Returns the value of attribute max_network_retries.
|
|
# File 'lib/forem/configuration.rb', line 36
|
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
|
|
# File 'lib/forem/configuration.rb', line 26
|
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
|
|
# File 'lib/forem/configuration.rb', line 31
|
Instance Method Details
#initialize_dup(source) ⇒ void
This method returns an undefined value.
Support duplicating a configuration via dup.
70 71 72 |
# File 'lib/forem/configuration.rb', line 70 def initialize_dup(source) super end |