Class: Grape::ServeFile::SendfileResponse

Inherits:
Rack::Response
  • Object
show all
Defined in:
lib/grape/serve_file/sendfile_response.rb

Overview

Response should respond to to_path method for using Rack::SendFile middleware

Instance Method Summary collapse

Instance Method Details

#respond_to?(method_name, include_all = false) ⇒ Boolean


6
7
8
9
10
11
12
# File 'lib/grape/serve_file/sendfile_response.rb', line 6

def respond_to?(method_name, include_all = false)
  if method_name == :to_path
    @body.respond_to?(:to_path, include_all)
  else
    super
  end
end

#to_pathObject


14
15
16
# File 'lib/grape/serve_file/sendfile_response.rb', line 14

def to_path
  @body.to_path
end