summaryrefslogtreecommitdiff
path: root/lib/gitlab/slash_commands/application_help.rb
blob: 8d747cab2a1f0b47796cad26dd9a7a652135058e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

module Gitlab
  module SlashCommands
    class ApplicationHelp < BaseCommand
      def initialize(project, params)
        @project = project
        @params = params
      end

      def execute
        Gitlab::SlashCommands::Presenters::Help
          .new(project, commands, params)
          .present(trigger, params[:text])
      end

      private

      def trigger
        params[:command].to_s
      end

      def commands
        Gitlab::SlashCommands::Command.commands
      end
    end
  end
end