class AeEasy::Qa::ValidateInternal

Attributes

collections[R]
data[R]
outputs[R]
rules[R]
scraper_name[R]

Public Class Methods

new(vars, config, outputs) click to toggle source
# File lib/ae_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
  @data = vars['data']
end

Public Instance Methods

run() click to toggle source
# File lib/ae_easy/qa/validate_internal.rb, line 14
def run
  begin
    ValidateScraper.new(scraper_name, collections, rules, outputs, thresholds, data).run
  rescue StandardError => e
    puts "An error has occurred: #{e}"
    return nil
  end
end

Private Instance Methods

thresholds() click to toggle source

thresholds are a setting where you can suppress errors if they are under a specific error rate

# File lib/ae_easy/qa/validate_internal.rb, line 26
def thresholds
  @thresholds ||= begin
                    file_path = File.expand_path('thresholds.yaml', Dir.pwd)
                    if File.exists? file_path
                      YAML.load(File.open(file_path))
                    else
                      nil
                    end
                  end
end