Class: Grape::ServeFile::FileResponse
- Inherits:
-
Object
- Object
- Grape::ServeFile::FileResponse
- Defined in:
- lib/grape/serve_file/file_response.rb
Overview
A simple class used to identify responses which represent files and do not need to be formatted or pre-read by Rack::Response
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Equality provided mostly for tests.
-
#initialize(file) ⇒ FileResponse
constructor
A new instance of FileResponse.
Constructor Details
#initialize(file) ⇒ FileResponse
Returns a new instance of FileResponse.
9 10 11 |
# File 'lib/grape/serve_file/file_response.rb', line 9 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/grape/serve_file/file_response.rb', line 6 def file @file end |
Instance Method Details
#==(other) ⇒ Boolean
Equality provided mostly for tests.
16 17 18 |
# File 'lib/grape/serve_file/file_response.rb', line 16 def ==(other) file == other.file end |