Class: Grape::ServeStream::SendfileResponse

Inherits:
Rack::Response
  • Object
show all
Defined in:
lib/grape/serve_stream/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

Returns:

  • (Boolean)

8
9
10
11
12
13
14
# File 'lib/grape/serve_stream/sendfile_response.rb', line 8

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


16
17
18
# File 'lib/grape/serve_stream/sendfile_response.rb', line 16

def to_path
  @body.to_path
end