Class: Gesund::Output::Text

Inherits:
Object
  • Object
show all
Defined in:
lib/gesund/output/text.rb

Instance Method Summary collapse

Constructor Details

#initialize(checks) ⇒ Text

Returns a new instance of Text.



3
4
5
6
7
8
9
10
11
# File 'lib/gesund/output/text.rb', line 3

def initialize(checks)
  results = Gesund::CheckRunner.run(checks)
  failflag = false
  results.each do |check|
    failflag = true if check.first.to_i != 200
    puts "#{check.first}: #{check.last.join}"
  end
  puts "\nRESULT: Health check #{failflag ? "failed!" : "passed."}"
end