Class: ConvenientService::RSpec::PrimitiveHelpers::Classes::IgnoringException
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::RSpec::PrimitiveHelpers::Classes::IgnoringException
- Defined in:
- lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb,
lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception/exceptions.rb
Defined Under Namespace
Modules: Exceptions
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Instance Method Summary collapse
- #call ⇒ ConvenientService::Support::UniqueValue
-
#initialize(exception, &block) ⇒ IgnoringException
constructor
A new instance of IgnoringException.
Methods inherited from Support::Command
Constructor Details
#initialize(exception, &block) ⇒ IgnoringException
Returns a new instance of IgnoringException.
31 32 33 34 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 31 def initialize(exception, &block) @exception = exception @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
25 26 27 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 25 def block @block end |
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
19 20 21 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 19 def exception @exception end |
Instance Method Details
#call ⇒ ConvenientService::Support::UniqueValue
Note:
Rescue StandardError
, NOT Exception
.
45 46 47 48 49 50 51 |
# File 'lib/convenient_service/rspec/primitive_helpers/classes/ignoring_exception.rb', line 45 def call block.call rescue exception Support::UNDEFINED else ::ConvenientService.raise Exceptions::IgnoredExceptionIsNotRaised.new(exception: exception) end |