Class: Wait::BaseRaiser
- Inherits:
-
Object
- Object
- Wait::BaseRaiser
- Defined in:
- lib/raisers/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #log(exception, raising) ⇒ Object
-
#raise?(exception) ⇒ Boolean
Returns
true
if an exception ought to be raised.
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/raisers/base.rb', line 3 def logger @logger end |
Instance Method Details
#log(exception, raising) ⇒ Object
12 13 14 15 16 |
# File 'lib/raisers/base.rb', line 12 def log(exception, raising) return if @logger.nil? @logger.debug("Raiser") { "#{"not " unless raising}raising: #{exception.class.name}" } end |
#raise?(exception) ⇒ Boolean
Returns true
if an exception ought to be raised.
6 7 8 9 10 |
# File 'lib/raisers/base.rb', line 6 def raise?(exception) false.tap do |raising| log(exception, raising) end end |