nutriscore 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5546badbbce48d13c565aa9adb7e0acccd1625916f11dcc77f34fb7fcb0571a6
4
- data.tar.gz: b884ceed940198537890c1d81be684baa0c30ff885776f9b661c22da5595c4f7
3
+ metadata.gz: 9499639b9270f1b3bc19d884149183d6173a68642ae69f4ec09f3e30cc35c7f5
4
+ data.tar.gz: 5acf670e3bbed2d36ab78e668aba6714b5c020fe582b445093743460691f43ae
5
5
  SHA512:
6
- metadata.gz: ec3de5c8ceaa94d7d445c8a25c95eaeb4f13133a4bcfd709513c86ce8b0b7a80753fe73fe96a42892f851079ac0090cecf49f536c6fd6db1d0c094bc0c1a6ead
7
- data.tar.gz: f6854b82b1fe9ba3ac30552466d16b79c85f6684beb48829f057300d758f883e36e923a53a34df03863e81965b58d2e617bc4f5dd3862aa85e6013902ee392eb
6
+ metadata.gz: 8b17f08fae8debdb1d2020d8ee011bb55b9151fcf1c5c5d1a64c76efa2767490a8513b4333378a727866d70f4118cffe2076b2751afc6d986ef2bb45d5b3f15a
7
+ data.tar.gz: 2a2aca72f97fc205402450f77be5625ea8a32fbb73ba9a9209e55337470925e78024c7c952638950fcd763f9f46cdd73656fcc28f1d7bd4050a8e74c0f7ea5cf
data/README.md CHANGED
@@ -97,6 +97,9 @@ Different categories can use different score classes:
97
97
  * `Nutriscore::FR::DrinksScore` for other drinks
98
98
  * `Nutriscore::FR::SpecificScore` for other food products
99
99
 
100
+ Note that the score classes may use different nutrients (there is one additional nutrient,
101
+ `fat_total`, used by `FatsScore`).
102
+
100
103
  ## UK
101
104
 
102
105
  The UK has the same basis for computation, but it is used to determine
@@ -122,8 +125,8 @@ score = Nutriscore::UK::SpecificScore.new(product_a, fibres_method: :nsp)
122
125
  ```
123
126
 
124
127
  Different categories can use different score classes:
125
- * `Nutriscore::EN::SpecificScore` for food products
126
- * `Nutriscore::EN::DrinksScore` for drinks
128
+ * `Nutriscore::UK::SpecificScore` for food products
129
+ * `Nutriscore::UK::DrinksScore` for drinks
127
130
 
128
131
  ## License
129
132
 
@@ -41,6 +41,10 @@ module Nutriscore
41
41
  end
42
42
  end
43
43
  end
44
+
45
+ def score_without_proteins
46
+ (self.class.nutrient_keys - [:proteins]).map(&method(:public_send)).compact.reduce(&:+)
47
+ end
44
48
  end
45
49
  end
46
50
  end
@@ -1,4 +1,4 @@
1
1
  module Nutriscore
2
- VERSION = '0.3.0'
3
- VERSION_DATE = '2022-05-05'
2
+ VERSION = '0.3.1'
3
+ VERSION_DATE = '2022-06-07'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nutriscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - wvengen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2022-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec