Class: LfsDownloadObject
- Inherits:
-
Object
- Object
- LfsDownloadObject
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/lfs_download_object.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#link ⇒ Object
Returns the value of attribute link.
-
#oid ⇒ Object
Returns the value of attribute oid.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #has_authorization_header? ⇒ Boolean
-
#initialize(oid:, size:, link:, headers: {}) ⇒ LfsDownloadObject
constructor
A new instance of LfsDownloadObject.
- #sanitized_uri ⇒ Object
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
#headers ⇒ Object
Returns the value of attribute headers.
6 7 8 |
# File 'app/models/lfs_download_object.rb', line 6 def headers @headers end |
#link ⇒ Object
Returns the value of attribute link.
6 7 8 |
# File 'app/models/lfs_download_object.rb', line 6 def link @link end |
#oid ⇒ Object
Returns the value of attribute oid.
6 7 8 |
# File 'app/models/lfs_download_object.rb', line 6 def oid @oid end |
#size ⇒ Object
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
26 27 28 |
# File 'app/models/lfs_download_object.rb', line 26 def headers.keys.map(&:downcase).include?('authorization') end |
#sanitized_uri ⇒ Object
22 23 24 |
# File 'app/models/lfs_download_object.rb', line 22 def sanitized_uri @sanitized_uri ||= Gitlab::UrlSanitizer.new(link) end |