Class: ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatMessage Private
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatMessage
- Defined in:
- lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #message ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ String private
- #initialize(message:) ⇒ void constructor private
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(message:) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 24 def initialize(message:) @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
18 19 20 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 18 def @message end |
Instance Method Details
#call ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Message formatting is inspired by RSpec. It has almost the same output (at least for RSpec 3).
Underscores are used to highlight spaces in docs, they are NOT included in the resulting message, check FormatException for a full example.
45 46 47 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 45 def call .to_s.chomp.split("\n").map { |line| line.prepend(Constants::MESSAGE_LINE_PREFIX) }.join("\n") end |