Class: Nomius::Checker

Inherits:
Object
  • Object
show all
Defined in:
lib/nomius/checker.rb

Overview

Checker

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#detectorsObject (readonly)

Returns the value of attribute detectors.



10
11
12
# File 'lib/nomius/checker.rb', line 10

def detectors
  @detectors
end

#loggerObject (readonly)

Returns the value of attribute logger.



10
11
12
# File 'lib/nomius/checker.rb', line 10

def logger
  @logger
end

#nameObject (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

#checkObject



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