pkulib 0.0.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 +7 -0
- data/lib/pkulib.rb +41 -0
- metadata +44 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ee78729191d7f704e723d8d71bf62a9fcdaebd0
|
4
|
+
data.tar.gz: d0c3d5fa7eba67113513a04181d549fc15a63e28
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f65ba6c37379a499bfd0200cafc9e888d3679db16f445ef51ee4807371e5b7c4263f08803b1d244297aeb19e97bf8a8be5dd3078083930f95b8dd5531b6397f3
|
7
|
+
data.tar.gz: cee913e957e66c290afea4288afe2580c5b31c6428e099124958781b2b6053a9dcf0bbdc171853acbf2e02e0a9fc97a96860581369926355068aae8c694cf1a6
|
data/lib/pkulib.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
class PKUlib
|
2
|
+
def self.oz2gram(ounces)
|
3
|
+
grams = ounces / 0.035274
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.mg2gram(milligrams)
|
7
|
+
grams = milligrams / 1000
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.floz2ml(floz)
|
11
|
+
ml = floz / 0.033814
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.litre2ml(litre)
|
15
|
+
ml = litre / 0.001
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.average(*numbers)
|
19
|
+
numbers.reduce(:+).to_f / numbers.size
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.phecalc(protein,qualifier)
|
23
|
+
if protein < 0.5
|
24
|
+
min = 0
|
25
|
+
max = 0.5 * 64.5
|
26
|
+
elsif qualifier == "fruit"
|
27
|
+
min = protein * 20
|
28
|
+
max = protein * 30
|
29
|
+
elsif qualifier == "veg"
|
30
|
+
min = protein * 20
|
31
|
+
max = protein * 40
|
32
|
+
else
|
33
|
+
min = protein * 20
|
34
|
+
max = protein * 64.5
|
35
|
+
end
|
36
|
+
{
|
37
|
+
:minimum => min,
|
38
|
+
:maximum => max
|
39
|
+
}
|
40
|
+
end
|
41
|
+
end
|
metadata
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pkulib
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Agans
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Methods pertinent to calculating phenylalanine content in food and beverage.
|
14
|
+
email: phwelo@sdf.ninja
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/pkulib.rb
|
20
|
+
homepage: http://rubygems.org/gems/pkulib
|
21
|
+
licenses:
|
22
|
+
- IDK
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubyforge_project:
|
40
|
+
rubygems_version: 2.5.1
|
41
|
+
signing_key:
|
42
|
+
specification_version: 4
|
43
|
+
summary: Methods pertinent to calculating phenylalanine in food or drink.
|
44
|
+
test_files: []
|