Class: Grape::ServeFile::FileResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ FileResponse

Returns a new instance of FileResponse

Parameters:

  • file (Object)

9
10
11
# File 'lib/grape/serve_file/file_response.rb', line 9

def initialize(file)
  @file = file
end

Instance Attribute Details

#fileObject (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.

Returns:

  • (Boolean)

16
17
18
# File 'lib/grape/serve_file/file_response.rb', line 16

def ==(other)
  file == other.file
end