Class: Dragonfly::Response
Constant Summary collapse
- DEFAULT_FILENAME =
proc{
Instance Method Summary collapse
-
#initialize(job, env) ⇒ Response
constructor
A new instance of Response.
- #to_response ⇒ Object
Constructor Details
#initialize(job, env) ⇒ Response
Returns a new instance of Response.
13 14 15 16 |
# File 'lib/dragonfly/response.rb', line 13 def initialize(job, env) @job, @env = job, env @app = @job.app end |
Instance Method Details
#to_response ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/dragonfly/response.rb', line 18 def to_response if etag_matches? # Not Modified [304, cache_headers, []] else # Success [200, success_headers.merge(cache_headers), job.result] end rescue DataStorage::DataNotFound => e [404, {"Content-Type" => 'text/plain'}, [e.]] end |