Class: ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatCause Private
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatCause
- Defined in:
- lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_cause.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
- #cause ⇒ Object readonly private
- #exception ⇒ StandardError? readonly
Instance Method Summary collapse
- #call ⇒ String private
- #initialize(cause:) ⇒ void constructor private
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(cause:) ⇒ 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_cause.rb', line 24 def initialize(cause:) @cause = cause end |
Instance Attribute Details
#cause ⇒ 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_cause.rb', line 18 def cause @cause end |
#exception ⇒ StandardError? (readonly)
18 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_cause.rb', line 18 attr_reader :cause |
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.
Note:
Cause formatting is inspired by RSpec. It has almost the same output (at least for RSpec 3).
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_cause.rb', line 41 def call return "" unless cause <<~MESSAGE.chomp ------------------ --- Caused by: --- #{formatted_cause_class} #{} #{formatted_cause_first_line} MESSAGE end |