module Shrine::Plugins::RackResponse::FileMethods

  1. lib/shrine/plugins/rack_response.rb

Methods

Public Instance

  1. to_rack_response

Public Instance methods

to_rack_response (disposition: "inline", range: false)

Returns a Rack response triple for the uploaded file.

[show source]
# File lib/shrine/plugins/rack_response.rb, line 63
def to_rack_response(disposition: "inline", range: false)
  range = parse_http_range(range) if range

  status  = range ? 206 : 200
  headers = rack_headers(disposition: disposition, range: range)
  body    = rack_body(range: range)

  [status, headers, body]
end