Class: Projects::LfsPointers::LfsDownloadService
- Inherits:
-
BaseService
- Object
- BaseService
- Projects::LfsPointers::LfsDownloadService
- Defined in:
- app/services/projects/lfs_pointers/lfs_download_service.rb
Constant Summary collapse
- SizeError =
Class.new(StandardError)
- OidError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#lfs_download_object ⇒ Object
readonly
Returns the value of attribute lfs_download_object.
Attributes inherited from BaseService
#current_user, #params, #project
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, lfs_download_object) ⇒ LfsDownloadService
constructor
A new instance of LfsDownloadService.
Methods included from BaseServiceUtility
#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level
Methods included from Gitlab::Allowable
Constructor Details
#initialize(project, lfs_download_object) ⇒ LfsDownloadService
Returns a new instance of LfsDownloadService.
13 14 15 16 17 |
# File 'app/services/projects/lfs_pointers/lfs_download_service.rb', line 13 def initialize(project, lfs_download_object) super(project) @lfs_download_object = lfs_download_object end |
Instance Attribute Details
#lfs_download_object ⇒ Object (readonly)
Returns the value of attribute lfs_download_object
10 11 12 |
# File 'app/services/projects/lfs_pointers/lfs_download_service.rb', line 10 def lfs_download_object @lfs_download_object end |
Instance Method Details
#execute ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/services/projects/lfs_pointers/lfs_download_service.rb', line 19 def execute return unless project&.lfs_enabled? && lfs_download_object return error("LFS file with oid #{lfs_oid} has invalid attributes") unless lfs_download_object.valid? wrap_download_errors do download_lfs_file! end end |