Class: WebFetch::Retriever
- Inherits:
-
Object
- Object
- WebFetch::Retriever
- Includes:
- Validatable
- Defined in:
- lib/web_fetch/retriever.rb
Overview
Retrieves a gathered HTTP request
Instance Attribute Summary
Attributes included from Validatable
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(storage, params, options) ⇒ Retriever
constructor
A new instance of Retriever.
Methods included from Validatable
Constructor Details
#initialize(storage, params, options) ⇒ Retriever
Returns a new instance of Retriever.
8 9 10 11 12 13 |
# File 'lib/web_fetch/retriever.rb', line 8 def initialize(storage, params, ) @uid = params[:uid] @hash = params[:hash] @storage = storage @block = .fetch(:block, true) end |
Instance Method Details
#find ⇒ Object
15 16 17 18 19 20 |
# File 'lib/web_fetch/retriever.rb', line 15 def find request = @storage.fetch(@uid) unless @uid.nil? return pending if request.nil? request end |