Class: Cosing::Annex::II
Defined Under Namespace
Classes: Rule
Class Method Summary collapse
Methods inherited from Base
#add_rule, #initialize, #keys, #lookup
Constructor Details
This class inherits a constructor from Cosing::Annex::Base
Class Method Details
.load ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/cosing/annex/ii.rb', line 10 def self.load new.tap do |annex| Annex.parse("data/annex.II.csv") do |row| ingredients = Cosing::Parser.transform_array!( row, key: :identified_ingredients, split: ";" ) annex.add_rule( row.merge( identified_ingredients: ingredients.compact ) ) end end end |