Class: Scruber::Core::Configuration
- Defined in:
- lib/scruber/core/configuration.rb
Overview
Configuration class
Instance Attribute Summary collapse
-
#autoload_paths ⇒ Array<String>
Array with paths for autoloading classes.
-
#fetcher_adapter ⇒ Symbol
Fetcher adapter name.
-
#fetcher_agent_adapter ⇒ Symbol
Fetcher agent adapter name.
-
#fetcher_agent_options ⇒ Hash
Fetcher agent options, see Helpers::FetcherAgentAdapters::AbstractAdapter.
-
#fetcher_options ⇒ Hash
Fetcher options, see FetcherAdapters::AbstractAdapter options.
-
#queue_adapter ⇒ Symbol
Queue adapter name.
-
#queue_options ⇒ Hash
Queue options, see QueueAdapters::AbstractAdapter.
-
#silent ⇒ Boolean
Don't output anything if true.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#merge_options(options) ⇒ void
Merge options from hash.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/scruber/core/configuration.rb', line 25 def initialize @fetcher_adapter = :typhoeus_fetcher @fetcher_options = {} @fetcher_agent_adapter = :memory @fetcher_agent_options = {} @queue_adapter = :memory @queue_options = {} @autoload_paths = [] @silent = false end |
Instance Attribute Details
#autoload_paths ⇒ Array<String>
Array with paths for autoloading classes
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def autoload_paths @autoload_paths end |
#fetcher_adapter ⇒ Symbol
Fetcher adapter name
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def fetcher_adapter @fetcher_adapter end |
#fetcher_agent_adapter ⇒ Symbol
Fetcher agent adapter name
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def fetcher_agent_adapter @fetcher_agent_adapter end |
#fetcher_agent_options ⇒ Hash
Fetcher agent options, see Helpers::FetcherAgentAdapters::AbstractAdapter
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def @fetcher_agent_options end |
#fetcher_options ⇒ Hash
Fetcher options, see FetcherAdapters::AbstractAdapter options
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def @fetcher_options end |
#queue_adapter ⇒ Symbol
Queue adapter name
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def queue_adapter @queue_adapter end |
#queue_options ⇒ Hash
Queue options, see QueueAdapters::AbstractAdapter
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def @queue_options end |
#silent ⇒ Boolean
Don't output anything if true
15 16 17 |
# File 'lib/scruber/core/configuration.rb', line 15 def silent @silent end |
Instance Method Details
#merge_options(options) ⇒ void
This method returns an undefined value.
Merge options from hash
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/scruber/core/configuration.rb', line 41 def () @fetcher_adapter = .fetch(:fetcher_adapter){ @fetcher_adapter } @fetcher_options.merge! .fetch(:fetcher_options){ {} } @fetcher_agent_adapter = .fetch(:fetcher_agent_adapter){ @fetcher_agent_adapter } @fetcher_agent_options.merge! .fetch(:fetcher_agent_options){ {} } @queue_adapter = .fetch(:queue_adapter){ @queue_adapter } @queue_options.merge! .fetch(:queue_options){ {} } @autoload_paths += .fetch(:autoload_paths){ [] } @silent = .fetch(:silent){ false } end |