debian-mirror-gitlab/lib/gitlab/slash_commands/application_help.rb

29 lines
556 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
module Gitlab
module SlashCommands
class ApplicationHelp < BaseCommand
2019-12-04 20:38:33 +05:30
def initialize(project, params)
@project = project
2019-07-07 11:18:12 +05:30
@params = params
end
def execute
2019-12-04 20:38:33 +05:30
Gitlab::SlashCommands::Presenters::Help
.new(project, commands)
.present(trigger, params[:text])
2019-07-07 11:18:12 +05:30
end
private
def trigger
"#{params[:command]} [project name or alias]"
end
def commands
Gitlab::SlashCommands::Command.commands
end
end
end
end