-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
property_set.rb
47 lines (42 loc) · 1.46 KB
/
property_set.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module PropertySet
NUTRITION_FACTS = {
serving_size: { type: :text },
servings_per_container: { type: :text },
calories: { type: :number },
fat_calories: { type: :number, title: 'Calories from Fat' },
fat: { unit: :g, type: :number, title: 'Total Fat' },
saturated_fat: { unit: :g, type: :number },
trans_fat: { unit: :g, type: :number },
polyunsaturated_fat: { unit: :g, type: :number },
monounsaturated_fat: { unit: :g, type: :number },
cholesterol: { unit: :mg, type: :number },
sodium: { unit: :mg, type: :number },
potassium: { unit: :mg, type: :number },
carbohydrate: { unit: :g, type: :number, title: 'Total Carbohydrate' },
fiber: { unit: :g, type: :number, title: 'Dietary Fibre' },
sugars: { unit: :g, type: :number },
protein: { unit: :g, type: :number }
}.freeze
INGREDIENTS = {
ingredients: { type: :text },
}
PUBLISHING_DETAILS = {
author: { type: :text },
format: { type: :text },
publisher: { type: :text },
pages: { type: :number }
}
PACK_DETAILS = {
weight_g: { unit: :g, type: :number },
weight_ounce: { unit: :oz, type: :number },
volume_ml: { unit: :ml, type: :number },
volume_fluid_ounce: { unit: :floz, type: :number },
unit_count: { type: :number },
alcohol_by_volume: { type: :number },
alcohol_by_weight: { type: :number },
}
ALL = NUTRITION_FACTS
.merge(INGREDIENTS)
.merge(PUBLISHING_DETAILS)
.merge(PACK_DETAILS)
end