Sha256: daebbf3c6e5fb35d9f4903c213535318c2df8136faa813c2c98298ccc9b02096

Contents?: true

Size: 454 Bytes

Versions: 3

Compression:

Stored size: 454 Bytes

Contents

module Grape
  module Util
    # 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

3 entries across 3 versions & 1 rubygems

Version Path
grape-0.15.0 lib/grape/util/file_response.rb
grape-0.14.0 lib/grape/util/file_response.rb
grape-0.13.0 lib/grape/util/file_response.rb