Method: Ingreedy::UnitVariationMapper.all_variations
- Defined in:
- lib/ingreedy/unit_variation_mapper.rb
.all_variations ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ingreedy/unit_variation_mapper.rb', line 8 def self.all_variations # Return these in order of size, descending # That way, the longer versions will try to be parsed first, # then the shorter versions # e.g. so '1 cup flour' will be parsed as 'cup' instead of 'c' variations_map.values.flatten.sort { |a, b| b.length <=> a.length } end |