lib/gitlab/file_response.rb in gitlab-4.5.0 vs lib/gitlab/file_response.rb in gitlab-4.6.0
- old
+ new
@@ -1,9 +1,11 @@
+# frozen_string_literal: true
+
module Gitlab
# Wrapper class of file response.
class FileResponse
- HEADER_CONTENT_DISPOSITION = 'Content-Disposition'.freeze
+ HEADER_CONTENT_DISPOSITION = 'Content-Disposition'
attr_reader :filename
def initialize(file)
@file = file
@@ -16,10 +18,10 @@
# @return [Hash] A hash consisting of filename and io object
def to_hash
{ filename: @filename, data: @file }
end
- alias_method :to_h, :to_hash
+ alias to_h to_hash
# @return [String] Formatted string with the class name, object id and filename.
def inspect
"#<#{self.class}:#{object_id} {filename: #{filename.inspect}}>"
end