Class: DhEasy::Qa::ValidateInternal

Inherits:
Object
  • Object
show all
Defined in:
lib/dh_easy/qa/validate_internal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vars, config, outputs) ⇒ ValidateInternal

Returns a new instance of ValidateInternal.



6
7
8
9
10
11
# File 'lib/dh_easy/qa/validate_internal.rb', line 6

def initialize(vars, config, outputs)
  @scraper_name = vars['scraper_name']
  @collections = vars['collections']
  @rules = config['individual_validations']
  @outputs = outputs
end

Instance Attribute Details

#collectionsObject (readonly)

Returns the value of attribute collections.



4
5
6
# File 'lib/dh_easy/qa/validate_internal.rb', line 4

def collections
  @collections
end

#outputsObject (readonly)

Returns the value of attribute outputs.



4
5
6
# File 'lib/dh_easy/qa/validate_internal.rb', line 4

def outputs
  @outputs
end

#rulesObject (readonly)

Returns the value of attribute rules.



4
5
6
# File 'lib/dh_easy/qa/validate_internal.rb', line 4

def rules
  @rules
end

#scraper_nameObject (readonly)

Returns the value of attribute scraper_name.



4
5
6
# File 'lib/dh_easy/qa/validate_internal.rb', line 4

def scraper_name
  @scraper_name
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
# File 'lib/dh_easy/qa/validate_internal.rb', line 13

def run
  begin
    ValidateScraper.new(scraper_name, collections, rules, outputs, thresholds).run
  rescue StandardError => e
    puts "An error has occurred: #{e}"
    return nil
  end
end