Class: Hospital::Formatter::Shell

Inherits:
Base
  • Object
show all
Defined in:
lib/hospital/formatter/shell.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #result

Constructor Details

This class inherits a constructor from Hospital::Formatter::Base

Instance Method Details

#put_diagnosis_header(text) ⇒ Object



12
13
14
# File 'lib/hospital/formatter/shell.rb', line 12

def put_diagnosis_header text
  @buffer << "\nChecking #{text.h2.indented}"
end

#put_diagnosis_result(text) ⇒ Object



29
30
31
# File 'lib/hospital/formatter/shell.rb', line 29

def put_diagnosis_result text
  @buffer << "\n#{text.indented}"
end

#put_diagnosis_skipped(text) ⇒ Object



16
17
18
# File 'lib/hospital/formatter/shell.rb', line 16

def put_diagnosis_skipped text
  @buffer << "\nSkipped #{text.h2.indented}"
end

#put_group_header(text) ⇒ Object



8
9
10
# File 'lib/hospital/formatter/shell.rb', line 8

def put_group_header text
  @buffer << "\n### #{text}".h1
end

#put_summary(errors_count, warnings_count) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/hospital/formatter/shell.rb', line 20

def put_summary errors_count, warnings_count
  @buffer <<  "\n    \#{\"Summary:\".h1}\n    \#{\"Errors:   \#{errors_count}\".red}\n    \#{\"Warnings: \#{warnings_count}\".yellow}\n  END\nend\n"