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 collapse
-
#not_found_error ⇒ Object
readonly
Returns the value of attribute not_found_error.
Attributes included from Validatable
Instance Method Summary collapse
- #find ⇒ Object
-
#initialize(server, params, options) ⇒ Retriever
constructor
A new instance of Retriever.
Methods included from Validatable
Constructor Details
#initialize(server, params, options) ⇒ Retriever
Returns a new instance of Retriever.
10 11 12 13 14 15 |
# File 'lib/web_fetch/retriever.rb', line 10 def initialize(server, params, ) @uid = params[:uid] @hash = params[:hash] @server = server @block = .fetch(:block, true) end |
Instance Attribute Details
#not_found_error ⇒ Object (readonly)
Returns the value of attribute not_found_error.
8 9 10 |
# File 'lib/web_fetch/retriever.rb', line 8 def not_found_error @not_found_error end |
Instance Method Details
#find ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/web_fetch/retriever.rb', line 17 def find request = @server.storage.fetch(@uid) return not_found if request.nil? return not_found if request.nil? return request.merge(pending: true) if pending?(request) request end |