Class: AeEasy::Qa::Validator
- Inherits:
-
Object
- Object
- AeEasy::Qa::Validator
- Defined in:
- lib/ae_easy/qa.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(data = nil, options = {}) ⇒ Validator
constructor
A new instance of Validator.
-
#validate_external(outputs, collection_name) ⇒ Object
this method is for validating data from “external” sources.
-
#validate_internal(vars, outputs) ⇒ Object
this method is for validating “internal” scrapers that run on AnswersEngine.
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, ={}) load_config @options = @data = data end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
16 17 18 |
# File 'lib/ae_easy/qa.rb', line 16 def config @config end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
17 18 19 |
# File 'lib/ae_easy/qa.rb', line 17 def data @data end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
17 18 19 |
# File 'lib/ae_easy/qa.rb', line 17 def errors @errors end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
17 18 19 |
# File 'lib/ae_easy/qa.rb', line 17 def @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, ).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 |