Class: Gitlab::SlashCommands::Help
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Gitlab::SlashCommands::Help
- Defined in:
- lib/gitlab/slash_commands/help.rb
Constant Summary
Constants inherited from BaseCommand
Instance Attribute Summary
Attributes inherited from BaseCommand
#chat_name, #current_user, #params, #project
Class Method Summary collapse
- .allowed?(_project, _user) ⇒ Boolean
- .help_message ⇒ Object
-
.match(_text) ⇒ Object
This class has to be used last, as it always matches.
Instance Method Summary collapse
Methods inherited from BaseCommand
available?, can?, #collection, #initialize
Constructor Details
This class inherits a constructor from Gitlab::SlashCommands::BaseCommand
Class Method Details
.allowed?(_project, _user) ⇒ Boolean
17 18 19 |
# File 'lib/gitlab/slash_commands/help.rb', line 17 def self.allowed?(_project, _user) true end |
.help_message ⇒ Object
13 14 15 |
# File 'lib/gitlab/slash_commands/help.rb', line 13 def self. 'help' end |
.match(_text) ⇒ Object
This class has to be used last, as it always matches. It has to match because other commands were not triggered and we want to show the help command
9 10 11 |
# File 'lib/gitlab/slash_commands/help.rb', line 9 def self.match(_text) true end |
Instance Method Details
#execute(commands, text) ⇒ Object
21 22 23 24 25 |
# File 'lib/gitlab/slash_commands/help.rb', line 21 def execute(commands, text) Gitlab::SlashCommands::Presenters::Help .new(project, commands) .present(trigger, text) end |
#trigger ⇒ Object
27 28 29 |
# File 'lib/gitlab/slash_commands/help.rb', line 27 def trigger params[:command] end |