Class: FSSM::Monitor

Inherits:
Object
  • Object
show all
Defined in:
lib/fssm/monitor.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Monitor

Returns a new instance of Monitor.



2
3
4
5
# File 'lib/fssm/monitor.rb', line 2

def initialize(options={})
  @options = options
  @backend = FSSM::Backends::Default.new
end

Instance Method Details

#path(*args, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fssm/monitor.rb', line 7

def path(*args, &block)
  path = FSSM::Path.new(*args)

  if block_given?
    if block.arity == 1
      block.call(path)
    else
      path.instance_eval(&block)
    end
  end

  @backend.add_path(path)
  path
end

#runObject



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

def run
  @backend.run
end