Class: Wait::BaseRaiser

Inherits:
Object
  • Object
show all
Defined in:
lib/raisers/base.rb

Direct Known Subclasses

PassiveRaiser, SignalRaiser

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

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.

Returns:

  • (Boolean)


6
7
8
9
10
# File 'lib/raisers/base.rb', line 6

def raise?(exception)
  false.tap do |raising|
    log(exception, raising)
  end
end