Class: Gitlab::SlashCommands::Presenters::Base

Inherits:
Object
  • Object
show all
Includes:
Routing
Defined in:
lib/gitlab/slash_commands/presenters/base.rb

Instance Method Summary collapse

Methods included from Routing

includes_helpers, redirect_legacy_paths, url_helpers

Constructor Details

#initialize(resource = nil) ⇒ Base

Returns a new instance of Base.



9
10
11
# File 'lib/gitlab/slash_commands/presenters/base.rb', line 9

def initialize(resource = nil)
  @resource = resource
end

Instance Method Details

#display_errorsObject



13
14
15
16
17
# File 'lib/gitlab/slash_commands/presenters/base.rb', line 13

def display_errors
  message = header_with_list("The action was not successful, because:", @resource.errors.full_messages)

  ephemeral_response(text: message)
end