Class: Chkex::Checker

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

Instance Method Summary collapse

Constructor Details

#initialize(domains, type) ⇒ Checker

Returns a new instance of Checker.



3
4
5
6
7
# File 'lib/chkex/checker.rb', line 3

def initialize(domains, type)
  @results = { success: {}, errors: {} }
  @domains = FileHandler.read_list(domains)
  @type = type
end

Instance Method Details

#testObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/chkex/checker.rb', line 9

def test
  case @type
  when :one
    @results = Source::One.new(@domains).results
  when :multiple
    @results = Source::List.new(@domains).results
  else
    raise Chkex::InitializationError
  end

  print_output
end