Class: Philae::Prober

Inherits:
Object
  • Object
show all
Defined in:
lib/philae/prober.rb

Instance Method Summary collapse

Constructor Details

#initializeProber

Returns a new instance of Prober.



3
4
5
# File 'lib/philae/prober.rb', line 3

def initialize
  @probes = []
end

Instance Method Details

#add_probe(probe) ⇒ Object



7
8
9
# File 'lib/philae/prober.rb', line 7

def add_probe(probe)
  @probes << probe
end

#checkObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/philae/prober.rb', line 11

def check
  probes_status = @probes.map do |probe|
    status = probe.check
    { name: probe.name, healthy: status[:healthy], comment: status[:comment] }
  end

  global = probes_status.all? do |probe|
    probe[:healthy]
  end

  return { healthy: global, probes: probes_status }
end