Class: AeEasy::Qa::ValidateScraper
- Inherits:
-
Object
- Object
- AeEasy::Qa::ValidateScraper
- Defined in:
- lib/ae_easy/qa/validate_internal.rb
Instance Attribute Summary collapse
-
#collections ⇒ Object
readonly
Returns the value of attribute collections.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#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.
Instance Method Summary collapse
-
#initialize(scraper_name, collections, rules, outputs, thresholds, data) ⇒ ValidateScraper
constructor
A new instance of ValidateScraper.
- #run ⇒ Object
Constructor Details
#initialize(scraper_name, collections, rules, outputs, thresholds, data) ⇒ ValidateScraper
Returns a new instance of ValidateScraper.
41 42 43 44 45 46 47 48 49 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 41 def initialize(scraper_name, collections, rules, outputs, thresholds, data) @scraper_name = scraper_name @collections = collections @rules = rules @outputs = outputs @options = {} @data = data ['thresholds'] = thresholds[scraper_name] if thresholds && thresholds[scraper_name] end |
Instance Attribute Details
#collections ⇒ Object (readonly)
Returns the value of attribute collections.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def collections @collections end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def data @data end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def @options end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def outputs @outputs end |
#rules ⇒ Object (readonly)
Returns the value of attribute rules.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def rules @rules end |
#scraper_name ⇒ Object (readonly)
Returns the value of attribute scraper_name.
39 40 41 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 39 def scraper_name @scraper_name end |
Instance Method Details
#run ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ae_easy/qa/validate_internal.rb', line 51 def run begin output_scraper if status_ok? validate_collections if collections && collections.any? else output_response return nil end rescue StandardError => e puts "An error has occurred for the scraper named '#{scraper_name}': #{e}" return nil end end |