Sha256: 6e61db53cb5d7ad304c0a557cc08fcb88cea185392c67fa63cd45a092e64dd46

Contents?: true

Size: 490 Bytes

Versions: 4

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Grape
  module ServeFile
    # A simple class used to identify responses which represent files and do not
    # need to be formatted or pre-read by Rack::Response
    class FileResponse
      attr_reader :file

      # @param file [Object]
      def initialize(file)
        @file = file
      end

      # Equality provided mostly for tests.
      #
      # @return [Boolean]
      def ==(other)
        file == other.file
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grape-1.3.3 lib/grape/serve_file/file_response.rb
grape-1.3.2 lib/grape/serve_file/file_response.rb
grape-1.3.1 lib/grape/serve_file/file_response.rb
grape-1.3.0 lib/grape/serve_file/file_response.rb