Class: Nzbn::Configuration
- Inherits:
-
Object
- Object
- Nzbn::Configuration
- Defined in:
- lib/nzbn/configuration.rb
Overview
Configuration class for NZBN client settings
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 |
# File 'lib/nzbn/configuration.rb', line 16 def initialize @api_key = nil @base_url = Nzbn::DEFAULT_BASE_URL @timeout = 30 @open_timeout = 10 @logger = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/nzbn/configuration.rb', line 14 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
14 15 16 |
# File 'lib/nzbn/configuration.rb', line 14 def base_url @base_url end |
#logger ⇒ Object
Returns the value of attribute logger.
14 15 16 |
# File 'lib/nzbn/configuration.rb', line 14 def logger @logger end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
14 15 16 |
# File 'lib/nzbn/configuration.rb', line 14 def open_timeout @open_timeout end |
#timeout ⇒ Object
Returns the value of attribute timeout.
14 15 16 |
# File 'lib/nzbn/configuration.rb', line 14 def timeout @timeout end |
Instance Method Details
#valid? ⇒ Boolean
24 25 26 |
# File 'lib/nzbn/configuration.rb', line 24 def valid? !api_key.nil? && !api_key.empty? end |