Class: TestTrack::MisconfigurationNotifier::Wrapper

Inherits:
Object
  • Object
show all
Defined in:
app/models/test_track/misconfiguration_notifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(underlying = Null.new) ⇒ Wrapper

Returns a new instance of Wrapper.



5
6
7
# File 'app/models/test_track/misconfiguration_notifier.rb', line 5

def initialize(underlying = Null.new)
  @underlying = underlying
end

Instance Attribute Details

#underlyingObject (readonly)

Returns the value of attribute underlying.



3
4
5
# File 'app/models/test_track/misconfiguration_notifier.rb', line 3

def underlying
  @underlying
end

Instance Method Details

#notify(msg) ⇒ Object



9
10
11
12
13
14
15
# File 'app/models/test_track/misconfiguration_notifier.rb', line 9

def notify(msg)
  raise msg if Rails.env.development?

  Rails.logger.error(msg)

  underlying.notify(msg)
end