Class: Nomius::BulkChecker

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

Overview

BulkChecker

Defined Under Namespace

Classes: RESULT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#detectorsObject (readonly)

Returns the value of attribute detectors.



14
15
16
# File 'lib/nomius/bulk_checker.rb', line 14

def detectors
  @detectors
end

#loggerObject (readonly)

Returns the value of attribute logger.



14
15
16
# File 'lib/nomius/bulk_checker.rb', line 14

def logger
  @logger
end

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

#checkObject



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