Module: Diagnostics::Methods
- Included in:
- Object
- Defined in:
- lib/diagnostics/methods.rb
Constant Summary collapse
- DIAGNOSTIC_MESSAGES =
{ :passed => 'All Systems Operational', :warning => 'Experiencing Issues', :failed => 'System Failure', :none => 'No Diagnostic Checks Run' }
Instance Method Summary collapse
- #diagnostic_check(name) ⇒ Object
- #diagnostic_checks ⇒ Object
- #diagnostic_message ⇒ Object
- #diagnostic_status ⇒ Object
Instance Method Details
#diagnostic_check(name) ⇒ Object
15 16 17 |
# File 'lib/diagnostics/methods.rb', line 15 def diagnostic_check(name) Check.find(name) end |
#diagnostic_checks ⇒ Object
11 12 13 |
# File 'lib/diagnostics/methods.rb', line 11 def diagnostic_checks Diagnostics.checks end |
#diagnostic_message ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/diagnostics/methods.rb', line 19 def case diagnostic_status when :passed then DIAGNOSTIC_MESSAGES[:passed] when :warning then DIAGNOSTIC_MESSAGES[:warning] when :failed then DIAGNOSTIC_MESSAGES[:failed] when :none then DIAGNOSTIC_MESSAGES[:none] end end |
#diagnostic_status ⇒ Object
28 29 30 31 32 33 |
# File 'lib/diagnostics/methods.rb', line 28 def diagnostic_status return :failed if diagnostic_statuses.include?(:failed) return :warning if diagnostic_statuses.include?(:warning) return :passed if diagnostic_statuses.include?(:passed) :none end |