Class: Integrations::SlackInteractions::BlockActionService

Inherits:
Object
  • Object
show all
Defined in:
app/services/integrations/slack_interactions/block_action_service.rb

Constant Summary collapse

ALLOWED_UPDATES_HANDLERS =
{
  'incident_management_project' => SlackInteractions::SlackBlockActions::IncidentManagement::ProjectUpdateHandler
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ BlockActionService

Returns a new instance of BlockActionService.



10
11
12
# File 'app/services/integrations/slack_interactions/block_action_service.rb', line 10

def initialize(params)
  @params = params
end

Instance Method Details

#executeObject



14
15
16
17
18
19
20
21
# File 'app/services/integrations/slack_interactions/block_action_service.rb', line 14

def execute
  actions.each do |action|
    action_id = action[:action_id]

    action_handler_class = ALLOWED_UPDATES_HANDLERS[action_id]
    action_handler_class.new(params, action).execute
  end
end