Class: AeEasy::Qa::ValidateCollection
- Inherits:
-
Object
- Object
- AeEasy::Qa::ValidateCollection
- Defined in:
- lib/ae_easy/qa/validate_internal.rb
Instance Attribute Summary collapse
-
#collection_name ⇒ Object
readonly
Returns the value of attribute collection_name.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#rules ⇒ Object
readonly
Returns the value of attribute rules.
-
#scraper_name ⇒ Object
readonly
Returns the value of attribute scraper_name.
-
#total_records ⇒ Object
readonly
Returns the value of attribute total_records.
Instance Method Summary collapse
-
#initialize(scraper_name, collection_name, total_records, rules, outputs, options) ⇒ ValidateCollection
constructor
A new instance of ValidateCollection.
- #run ⇒ Object
Constructor Details
#initialize(scraper_name, collection_name, total_records, rules, outputs, options) ⇒ ValidateCollection
Returns a new instance of ValidateCollection.
117 118 119 120 121 122 123 124 125 126 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 117 def initialize(scraper_name, collection_name, total_records, rules, outputs, ) @scraper_name = scraper_name @collection_name = collection_name @total_records = total_records @rules = rules @outputs = outputs @data = ['data'] @options = @errors = { errored_items: [] } end |
Instance Attribute Details
#collection_name ⇒ Object (readonly)
Returns the value of attribute collection_name.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def collection_name @collection_name end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def errors @errors end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def @options end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def outputs @outputs end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def rules @rules end |
#scraper_name ⇒ Object (readonly)
Returns the value of attribute scraper_name.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def scraper_name @scraper_name end |
#total_records ⇒ Object (readonly)
Returns the value of attribute total_records.
115 116 117 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 115 def total_records @total_records end |
Instance Method Details
#run ⇒ Object
128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 128 def run output_collection if most_recent_finished_job puts "data count #{data.count}" if data.any? ValidateGroups.new(data, scraper_name, collection_name, errors).run ValidateRules.new(data, errors, rules).run if rules end SaveOutput.new(data.count, rules, errors, outputs_collection_name, outputs, ).run else puts "No job with status 'done' available" end end |