Class: ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatException
- Inherits:
-
ConvenientService::Support::Command
- Object
- ConvenientService::Support::Command
- ConvenientService::Service::Plugins::RescuesResultUnhandledExceptions::Commands::FormatException
- Defined in:
- lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#kwargs ⇒ Object
readonly
Returns the value of attribute kwargs.
-
#max_backtrace_size ⇒ Object
readonly
Returns the value of attribute max_backtrace_size.
Instance Method Summary collapse
- #call ⇒ String
- #initialize(exception:, args:, kwargs:, block:, max_backtrace_size: Constants::DEFAULT_MAX_BACKTRACE_SIZE) ⇒ void constructor
Methods inherited from ConvenientService::Support::Command
Constructor Details
#initialize(exception:, args:, kwargs:, block:, max_backtrace_size: Constants::DEFAULT_MAX_BACKTRACE_SIZE) ⇒ void
47 48 49 50 51 52 53 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 47 def initialize(exception:, args:, kwargs:, block:, max_backtrace_size: Constants::DEFAULT_MAX_BACKTRACE_SIZE) @exception = exception @args = args @kwargs = kwargs @block = block @max_backtrace_size = max_backtrace_size end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
25 26 27 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 25 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
37 38 39 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 37 def block @block end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
13 14 15 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 13 def exception @exception end |
#kwargs ⇒ Object (readonly)
Returns the value of attribute kwargs.
31 32 33 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 31 def kwargs @kwargs end |
#max_backtrace_size ⇒ Object (readonly)
Returns the value of attribute max_backtrace_size.
19 20 21 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 19 def max_backtrace_size @max_backtrace_size end |
Instance Method Details
#call ⇒ String
Note:
Exceptions formatting is inspired by RSpec. It has almost the same output (at least for RSpec 3).
133 134 135 136 137 138 139 140 |
# File 'lib/convenient_service/service/plugins/rescues_result_unhandled_exceptions/commands/format_exception.rb', line 133 def call <<~MESSAGE.rstrip #{formatted_exception_class} #{} #{formatted_exception_backtrace} #{formatted_exception_cause} MESSAGE end |