Class: LfsDownloadObject

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/lfs_download_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(oid:, size:, link:, headers: {}) ⇒ LfsDownloadObject

Returns a new instance of LfsDownloadObject.



15
16
17
18
19
20
# File 'app/models/lfs_download_object.rb', line 15

def initialize(oid:, size:, link:, headers: {})
  @oid = oid
  @size = size
  @link = link
  @headers = headers || {}
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



6
7
8
# File 'app/models/lfs_download_object.rb', line 6

def headers
  @headers
end

Returns the value of attribute link.



6
7
8
# File 'app/models/lfs_download_object.rb', line 6

def link
  @link
end

#oidObject

Returns the value of attribute oid.



6
7
8
# File 'app/models/lfs_download_object.rb', line 6

def oid
  @oid
end

#sizeObject

Returns the value of attribute size.



6
7
8
# File 'app/models/lfs_download_object.rb', line 6

def size
  @size
end

Instance Method Details

#has_authorization_header?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'app/models/lfs_download_object.rb', line 26

def has_authorization_header?
  headers.keys.map(&:downcase).include?('authorization')
end

#sanitized_uriObject



22
23
24
# File 'app/models/lfs_download_object.rb', line 22

def sanitized_uri
  @sanitized_uri ||= Gitlab::UrlSanitizer.new(link)
end