Welcome to mirror list, hosted at ThFree Co, Russian Federation.

application_help.rb « slash_commands « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a92346be1561eb73576a930234933411bc06441 (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)
          .present(trigger, params[:text])
      end

      private

      def trigger
        "#{params[:command]} [project name or alias]"
      end

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