foodfitrecommandation 0.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.rb +19 -12
- data/lib/foodfitrecommandation/version.rb +1 -1
- metadata +2 -2
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
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "foodfitrecommandation/version"
|
2
2
|
|
3
|
-
module Foodfitrecommandation
|
3
|
+
#module Foodfitrecommandation
|
4
4
|
class Error < StandardError; end
|
5
5
|
class UserClass
|
6
6
|
def self.recommends(result1,result2)
|
@@ -17,18 +17,25 @@ module Foodfitrecommandation
|
|
17
17
|
@tempObject = nil
|
18
18
|
|
19
19
|
@resultArray = result
|
20
|
-
#@resultArray.each do |t|
|
21
|
-
# puts "#{t.person_id}===>#{t.category_id}===>#{t.count}"
|
22
|
-
# if(t.count>@temp)
|
23
|
-
# @temp = t.count
|
24
|
-
# @tempObject = t
|
25
|
-
# end
|
26
20
|
result_count = Hash.new(0)
|
27
|
-
resultArray.each {|pet| result_count[pet] += 1}
|
21
|
+
@resultArray.each {|pet| result_count[pet] += 1}
|
22
|
+
return result_count.sort_by { |pet,number| number}.last[0]
|
23
|
+
end
|
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}
|
28
38
|
return result_count.sort_by { |pet,number| number}.last[0]
|
29
|
-
#end
|
30
|
-
# puts @tempObject
|
31
|
-
# return @tempObject
|
32
39
|
end
|
33
40
|
end
|
34
41
|
# end
|
@@ -46,4 +53,4 @@ class FoodfitRecommendationClassCaller
|
|
46
53
|
end
|
47
54
|
|
48
55
|
end
|
49
|
-
end
|
56
|
+
#end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foodfitrecommandation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nitin gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|