class Shrine::Plugins::RackResponse::FileResponse

  1. lib/shrine/plugins/rack_response.rb
Superclass: Object

Methods

Public Class

  1. new

Public Instance

  1. call
  2. file

Attributes

file [R]

Public Class methods

new(file)
[show source]
   # File lib/shrine/plugins/rack_response.rb
21 def initialize(file)
22   @file = file
23 end

Public Instance methods

call(**options)

Returns a Rack response triple for the uploaded file.

[show source]
   # File lib/shrine/plugins/rack_response.rb
26 def call(**options)
27   file.open unless file.opened?
28 
29   options[:range] = parse_content_range(options[:range]) if options[:range]
30 
31   status  = rack_status(**options)
32   headers = rack_headers(**options)
33   body    = rack_body(**options)
34 
35   [status, headers, body]
36 end