Class: WebFetch::Gatherer
- Inherits:
-
Object
- Object
- WebFetch::Gatherer
- Includes:
- Validatable
- Defined in:
- lib/web_fetch/gatherer.rb
Overview
Handles requests to gather URLs and delegates to the EventMachine web server
Constant Summary collapse
- HASHABLE_KEYS =
i[url query_string headers method].freeze
Instance Attribute Summary
Attributes included from Validatable
Instance Method Summary collapse
-
#initialize(storage, params, logger = Logger, http = EM::HttpRequest) ⇒ Gatherer
constructor
A new instance of Gatherer.
- #start ⇒ Object
Methods included from Validatable
Constructor Details
#initialize(storage, params, logger = Logger, http = EM::HttpRequest) ⇒ Gatherer
Returns a new instance of Gatherer.
11 12 13 14 15 16 |
# File 'lib/web_fetch/gatherer.rb', line 11 def initialize(storage, params, logger = Logger, http = EM::HttpRequest) @requests = params[:requests] @storage = storage @logger = logger @http = http end |
Instance Method Details
#start ⇒ Object
18 19 20 21 22 |
# File 'lib/web_fetch/gatherer.rb', line 18 def start tagged = { requests: tag_requests } gather(tagged[:requests]) tagged end |