Class: Nomius::BulkChecker
- Inherits:
-
Object
- Object
- Nomius::BulkChecker
- Defined in:
- lib/nomius/bulk_checker.rb
Overview
BulkChecker
Defined Under Namespace
Classes: RESULT
Instance Attribute Summary collapse
-
#detectors ⇒ Object
readonly
Returns the value of attribute detectors.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#names ⇒ Object
readonly
Returns the value of attribute names.
Class Method Summary collapse
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(names: [], detectors: Detector.all, logger: Logger::Silent.new) ⇒ BulkChecker
constructor
A new instance of BulkChecker.
Constructor Details
#initialize(names: [], detectors: Detector.all, logger: Logger::Silent.new) ⇒ BulkChecker
Returns a new instance of BulkChecker.
20 21 22 23 24 |
# File 'lib/nomius/bulk_checker.rb', line 20 def initialize(names: [], detectors: Detector.all, logger: Logger::Silent.new) @names = names.compact.map { |name| Name.for(name) } @detectors = detectors @logger = logger end |
Instance Attribute Details
#detectors ⇒ Object (readonly)
Returns the value of attribute detectors.
14 15 16 |
# File 'lib/nomius/bulk_checker.rb', line 14 def detectors @detectors end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/nomius/bulk_checker.rb', line 14 def logger @logger end |
#names ⇒ Object (readonly)
Returns the value of attribute names.
14 15 16 |
# File 'lib/nomius/bulk_checker.rb', line 14 def names @names end |
Class Method Details
.check(*args, **kwargs) ⇒ Object
16 17 18 |
# File 'lib/nomius/bulk_checker.rb', line 16 def self.check(*args, **kwargs) new(*args, **kwargs).check end |
Instance Method Details
#check ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/nomius/bulk_checker.rb', line 26 def check logger.start_batch_processing(names.count) names.map do |name| logger.batch_record_processing(name) do RESULT.new( name: name, results: Checker.check(name: name, detectors: detectors, logger: logger) ) end end end |