class DhEasy::Qa::Validator

Attributes

data[R]
errors[R]
local_config[R]
options[R]

Public Class Methods

new(data=nil, options={}) click to toggle source
# File lib/dh_easy/qa/validator.rb, line 6
def initialize(data=nil, options={})
  load_config
  @options = options
  @data = data
end

Public Instance Methods

config() click to toggle source

Configuration.

@return [Hash]

# File lib/dh_easy/qa/validator.rb, line 25
def config
  @config ||= local_config['qa']
end
config=(value) click to toggle source

Configuration.

@param [Hash] value Configuration.

@return [Hash]

# File lib/dh_easy/qa/validator.rb, line 34
def config=value
  @config = value
end
validate_external(outputs, collection_name) click to toggle source

this method is for validating data from “external” sources

# File lib/dh_easy/qa/validator.rb, line 18
def validate_external(outputs, collection_name)
  ValidateExternal.new(data, config, outputs, collection_name, options).run
end
validate_internal(vars, outputs) click to toggle source

this method is for validating “internal” scrapers that run on Datahen

# File lib/dh_easy/qa/validator.rb, line 13
def validate_internal(vars, outputs)
  ValidateInternal.new(vars, config, outputs).run
end

Private Instance Methods

config_path() click to toggle source
# File lib/dh_easy/qa/validator.rb, line 44
def config_path
  local_config.file_path
end
load_config() click to toggle source
# File lib/dh_easy/qa/validator.rb, line 40
def load_config
  @local_config ||= DhEasy::Config::Local.new
end