Class: Nomius::Checker
- Inherits:
-
Object
- Object
- Nomius::Checker
- Defined in:
- lib/nomius/checker.rb
Overview
Checker
Instance Attribute Summary collapse
-
#detectors ⇒ Object
readonly
Returns the value of attribute detectors.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(name:, detectors: Detector.all, logger: Logger::Silent.new) ⇒ Checker
constructor
A new instance of Checker.
Constructor Details
#initialize(name:, detectors: Detector.all, logger: Logger::Silent.new) ⇒ Checker
Returns a new instance of Checker.
16 17 18 19 20 |
# File 'lib/nomius/checker.rb', line 16 def initialize(name:, detectors: Detector.all, logger: Logger::Silent.new) @name = Name.for(name) @detectors = detectors @logger = logger end |
Instance Attribute Details
#detectors ⇒ Object (readonly)
Returns the value of attribute detectors.
10 11 12 |
# File 'lib/nomius/checker.rb', line 10 def detectors @detectors end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
10 11 12 |
# File 'lib/nomius/checker.rb', line 10 def logger @logger end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/nomius/checker.rb', line 10 def name @name end |
Class Method Details
.check(*args, **kwargs) ⇒ Object
12 13 14 |
# File 'lib/nomius/checker.rb', line 12 def self.check(*args, **kwargs) new(*args, **kwargs).check end |
Instance Method Details
#check ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/nomius/checker.rb', line 22 def check detectors.map do |detector| logger.log_detector_status do detector.status(name: name, logger: logger) end end end |