Class: Workarea::Lint::SkusMissingPricing

Inherits:
Workarea::Lint show all
Defined in:
lib/workarea/lint/skus_missing_pricing.rb

Instance Attribute Summary

Attributes inherited from Workarea::Lint

#errors, #warnings

Instance Method Summary collapse

Methods inherited from Workarea::Lint

#catalog_skus, #error, #initialize, #inventory_skus, lint_classes, lints_paths, load_lint_classes, #pricing_skus, run, #warn

Constructor Details

This class inherits a constructor from Workarea::Lint

Instance Method Details

#runObject



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/workarea/lint/skus_missing_pricing.rb', line 4

def run
  catalog_skus.each do |sku|
    unless pricing_skus.include?(sku)
      error("#{sku},Has Catalog::Variant but no matching Pricing::Sku")
    end
  end

  inventory_skus.each do |sku|
    if !catalog_skus.include?(sku) && !pricing_skus.include?(sku)
      error("#{sku},Has Inventory::Sku but no matching Pricing::Sku")
    end
  end
end