Class: Gitlab::SlashCommands::IssueShow
- Inherits:
-
IssueCommand
- Object
- BaseCommand
- IssueCommand
- Gitlab::SlashCommands::IssueShow
- Defined in:
- lib/gitlab/slash_commands/issue_show.rb
Constant Summary
Constants inherited from BaseCommand
Instance Attribute Summary
Attributes inherited from BaseCommand
#chat_name, #current_user, #params, #project
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from IssueCommand
Methods inherited from BaseCommand
allowed?, available?, can?, #collection, #initialize
Constructor Details
This class inherits a constructor from Gitlab::SlashCommands::BaseCommand
Class Method Details
.help_message ⇒ Object
10 11 12 |
# File 'lib/gitlab/slash_commands/issue_show.rb', line 10 def self. "issue show <id>" end |
.match(text) ⇒ Object
6 7 8 |
# File 'lib/gitlab/slash_commands/issue_show.rb', line 6 def self.match(text) /\Aissue\s+show\s+#{Issue.reference_prefix}?(?<iid>\d+)/.match(text) end |
Instance Method Details
#execute(match) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/gitlab/slash_commands/issue_show.rb', line 14 def execute(match) issue = find_by_iid(match[:iid]) if issue Gitlab::SlashCommands::Presenters::IssueShow.new(issue).present else Gitlab::SlashCommands::Presenters::Access.new.not_found end end |