Class: ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatMessage
- 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
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #call ⇒ String
- #initialize(message:) ⇒ void constructor
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(message:) ⇒ void
19 20 21 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 19 def initialize(message:) @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
13 14 15 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 13 def @message end |
Instance Method Details
#call ⇒ String
Note:
Message formatting is inspired by RSpec. It has almost the same output (at least for RSpec 3).
Note:
Underscores are used to highlight spaces in docs, they are NOT included in the resulting message, check ‘FormatException` for a full example.
40 41 42 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_message.rb', line 40 def call .to_s.chomp.split("\n").map { |line| line.prepend(Constants::MESSAGE_LINE_PREFIX) }.join("\n") end |