Class: Snippets::BaseService
- Inherits:
-
BaseProjectService
- Object
- BaseContainerService
- BaseProjectService
- Snippets::BaseService
- Defined in:
- app/services/snippets/base_service.rb
Direct Known Subclasses
Constant Summary collapse
- UPDATE_COMMIT_MSG =
'Update snippet'
- INITIAL_COMMIT_MSG =
'Initial commit'
- CreateRepositoryError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#snippet_actions ⇒ Object
readonly
Returns the value of attribute snippet_actions.
-
#uploaded_assets ⇒ Object
readonly
Returns the value of attribute uploaded_assets.
Attributes inherited from BaseProjectService
Attributes inherited from BaseContainerService
#container, #current_user, #group, #params, #project
Instance Method Summary collapse
-
#initialize(project: nil, current_user: nil, params: {}) ⇒ BaseService
constructor
A new instance of BaseService.
Methods inherited from BaseContainerService
#group_container?, #namespace_container?, #project_container?, #project_group
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: nil, current_user: nil, params: {}) ⇒ BaseService
Returns a new instance of BaseService.
12 13 14 15 16 17 18 19 |
# File 'app/services/snippets/base_service.rb', line 12 def initialize(project: nil, current_user: nil, params: {}) super @uploaded_assets = Array(@params.delete(:files).presence) input_actions = Array(@params.delete(:snippet_actions).presence) @snippet_actions = SnippetInputActionCollection.new(input_actions, allowed_actions: restricted_files_actions) end |
Instance Attribute Details
#snippet_actions ⇒ Object (readonly)
Returns the value of attribute snippet_actions.
10 11 12 |
# File 'app/services/snippets/base_service.rb', line 10 def snippet_actions @snippet_actions end |
#uploaded_assets ⇒ Object (readonly)
Returns the value of attribute uploaded_assets.
10 11 12 |
# File 'app/services/snippets/base_service.rb', line 10 def uploaded_assets @uploaded_assets end |