Class: ResourceEvents::MergeIntoNotesService
- Inherits:
-
Object
- Object
- ResourceEvents::MergeIntoNotesService
- Includes:
- Gitlab::Utils::StrongMemoize
- Defined in:
- app/services/resource_events/merge_into_notes_service.rb
Constant Summary collapse
- SYNTHETIC_NOTE_BUILDER_SERVICES =
[ SyntheticLabelNotesBuilderService, SyntheticMilestoneNotesBuilderService, SyntheticStateNotesBuilderService ].freeze
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
- #execute(notes = []) ⇒ Object
-
#initialize(resource, current_user, params = {}) ⇒ MergeIntoNotesService
constructor
A new instance of MergeIntoNotesService.
Constructor Details
#initialize(resource, current_user, params = {}) ⇒ MergeIntoNotesService
Returns a new instance of MergeIntoNotesService.
20 21 22 23 24 |
# File 'app/services/resource_events/merge_into_notes_service.rb', line 20 def initialize(resource, current_user, params = {}) @resource = resource @current_user = current_user @params = params end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
18 19 20 |
# File 'app/services/resource_events/merge_into_notes_service.rb', line 18 def current_user @current_user end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
18 19 20 |
# File 'app/services/resource_events/merge_into_notes_service.rb', line 18 def params @params end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
18 19 20 |
# File 'app/services/resource_events/merge_into_notes_service.rb', line 18 def resource @resource end |
Instance Method Details
#execute(notes = []) ⇒ Object
26 27 28 |
# File 'app/services/resource_events/merge_into_notes_service.rb', line 26 def execute(notes = []) (notes + synthetic_notes).sort_by(&:created_at) end |