Class: AeEasy::Qa::Validator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = nil, options = {}) ⇒ Validator

Returns a new instance of Validator.



19
20
21
22
23
# File 'lib/ae_easy/qa.rb', line 19

def initialize(data=nil, options={})
  load_config
  @options = options
  @data = data
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



16
17
18
# File 'lib/ae_easy/qa.rb', line 16

def config
  @config
end

#dataObject (readonly)

Returns the value of attribute data.



17
18
19
# File 'lib/ae_easy/qa.rb', line 17

def data
  @data
end

#errorsObject (readonly)

Returns the value of attribute errors.



17
18
19
# File 'lib/ae_easy/qa.rb', line 17

def errors
  @errors
end

#optionsObject (readonly)

Returns the value of attribute options.



17
18
19
# File 'lib/ae_easy/qa.rb', line 17

def options
  @options
end

Instance Method Details

#validate_external(outputs, collection_name) ⇒ Object

this method is for validating data from “external” sources



31
32
33
# File 'lib/ae_easy/qa.rb', line 31

def validate_external(outputs, collection_name)
  ValidateExternal.new(data, config, outputs, collection_name, options).run
end

#validate_internal(vars, outputs) ⇒ Object

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



26
27
28
# File 'lib/ae_easy/qa.rb', line 26

def validate_internal(vars, outputs)
  ValidateInternal.new(vars, config, outputs).run
end