Class: DAF::Monitor

Inherits:
Object
  • Object
show all
Includes:
Configurable
Defined in:
lib/daf/monitor.rb

Overview

Stores information relating to things being monitored sub-classes define specific criteria for when a monitor should ‘go off’. Has only one method, #on_trigger, that allows you to begin monitoring for an event

Direct Known Subclasses

FileUpdateMonitor

Instance Method Summary collapse

Methods included from Configurable

included

Constructor Details

#initialize(options) ⇒ Monitor

Requires the set of options expected by this monitor

the type of each option must match that expected or an exception will be raised

Parameters:

  • options (Hash)

    The options in key/value format,



16
17
18
# File 'lib/daf/monitor.rb', line 16

def initialize(options)
  process_options(options)
end

Instance Method Details

#on_triggerObject

Begins monitoring for event, when event occurs will execute required block parameter



22
23
24
25
# File 'lib/daf/monitor.rb', line 22

def on_trigger
  block_until_triggered
  yield
end