foodfitrecommandation 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/foodfitrecommandation/version.rb +1 -1
- data/lib/foodfitrecommandation.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efe6bef7f43a4a6f74cfcbce229e6a7c5cbbe807a4093ae496da8bf6286d8a30
|
4
|
+
data.tar.gz: 9ea39b85d4f7e996c4b0175064133e205871c90abe9b750b6125f6cd403fb03b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4fdd5ea892cbd9859e9070c1dd6589b9a50d0b5cb01f0e863c38064d8bbf0849226cb47b514f87d4762d74c36530c6c92d8123d5d504ba9cb0da6ce92433d78
|
7
|
+
data.tar.gz: 39dfdd29bc6d6d030b3581423e4c2f74c1b23e35180eeda785f330a4418314cf24efeba8070d4d43076376618aef1eee2ae5e4a180dc09b581b9feec2e38c63a
|
@@ -22,6 +22,22 @@ require "foodfitrecommandation/version"
|
|
22
22
|
return result_count.sort_by { |pet,number| number}.last[0]
|
23
23
|
end
|
24
24
|
end
|
25
|
+
|
26
|
+
#recommandation based on number of quantity
|
27
|
+
class FoodfitRecommendationClassBasedOnquantity < UserClass
|
28
|
+
@resultArray = []
|
29
|
+
|
30
|
+
def recommends(result,result2)
|
31
|
+
|
32
|
+
@temp = 0
|
33
|
+
@tempObject = nil
|
34
|
+
|
35
|
+
@resultArray = result
|
36
|
+
result_count = Hash.new(0)
|
37
|
+
@resultArray.each {|pet| result_count[pet] += 1}
|
38
|
+
return result_count.sort_by { |pet,number| number}.last[0]
|
39
|
+
end
|
40
|
+
end
|
25
41
|
# end
|
26
42
|
|
27
43
|
class FoodfitRecommendationClassCaller
|