foodAIHE 3.3.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 +7 -0
- data/.gitignore +12 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/Guardfile +82 -0
- data/LICENSE.txt +21 -0
- data/README.md +70 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/docs/DLLModule/DLL.html +1185 -0
- data/docs/DLLModule/Node.html +409 -0
- data/docs/DLLModule.html +126 -0
- data/docs/Food.html +567 -0
- data/docs/FoodAbstract.html +807 -0
- data/docs/FoodGem.html +156 -0
- data/docs/_config.yml +1 -0
- data/docs/_index.html +154 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +161 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +161 -0
- data/docs/input/food-data.txt +19 -0
- data/docs/input/samples-data.txt +9 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +267 -0
- data/docs/top-level-namespace.html +297 -0
- data/food.gemspec +41 -0
- data/lib/food/dll.rb +168 -0
- data/lib/food/food_class.rb +132 -0
- data/lib/food/version.rb +6 -0
- data/lib/food.rb +91 -0
- metadata +165 -0
@@ -0,0 +1,267 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>Method List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div id="content">
|
23
|
+
<div class="fixed_header">
|
24
|
+
<h1 id="full_list_header">Method List</h1>
|
25
|
+
<div id="full_list_nav">
|
26
|
+
|
27
|
+
<span><a target="_self" href="class_list.html">
|
28
|
+
Classes
|
29
|
+
</a></span>
|
30
|
+
|
31
|
+
<span><a target="_self" href="method_list.html">
|
32
|
+
Methods
|
33
|
+
</a></span>
|
34
|
+
|
35
|
+
<span><a target="_self" href="file_list.html">
|
36
|
+
Files
|
37
|
+
</a></span>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">Search: <input type="text" /></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<ul id="full_list" class="method">
|
45
|
+
|
46
|
+
|
47
|
+
<li class="odd ">
|
48
|
+
<div class="item">
|
49
|
+
<span class='object_link'><a href="Food.html#<=>-instance_method" title="Food#<=> (method)">#<=></a></span>
|
50
|
+
<small>Food</small>
|
51
|
+
</div>
|
52
|
+
</li>
|
53
|
+
|
54
|
+
|
55
|
+
<li class="even ">
|
56
|
+
<div class="item">
|
57
|
+
<span class='object_link'><a href="FoodAbstract.html#calculate_energetic_content-instance_method" title="FoodAbstract#calculate_energetic_content (method)">#calculate_energetic_content</a></span>
|
58
|
+
<small>FoodAbstract</small>
|
59
|
+
</div>
|
60
|
+
</li>
|
61
|
+
|
62
|
+
|
63
|
+
<li class="odd ">
|
64
|
+
<div class="item">
|
65
|
+
<span class='object_link'><a href="DLLModule/DLL.html#delete-instance_method" title="DLLModule::DLL#delete (method)">#delete</a></span>
|
66
|
+
<small>DLLModule::DLL</small>
|
67
|
+
</div>
|
68
|
+
</li>
|
69
|
+
|
70
|
+
|
71
|
+
<li class="even ">
|
72
|
+
<div class="item">
|
73
|
+
<span class='object_link'><a href="DLLModule/DLL.html#each-instance_method" title="DLLModule::DLL#each (method)">#each</a></span>
|
74
|
+
<small>DLLModule::DLL</small>
|
75
|
+
</div>
|
76
|
+
</li>
|
77
|
+
|
78
|
+
|
79
|
+
<li class="odd ">
|
80
|
+
<div class="item">
|
81
|
+
<span class='object_link'><a href="DLLModule/DLL.html#empty%3F-instance_method" title="DLLModule::DLL#empty? (method)">#empty?</a></span>
|
82
|
+
<small>DLLModule::DLL</small>
|
83
|
+
</div>
|
84
|
+
</li>
|
85
|
+
|
86
|
+
|
87
|
+
<li class="even ">
|
88
|
+
<div class="item">
|
89
|
+
<span class='object_link'><a href="FoodAbstract.html#energetic_content-instance_method" title="FoodAbstract#energetic_content (method)">#energetic_content</a></span>
|
90
|
+
<small>FoodAbstract</small>
|
91
|
+
</div>
|
92
|
+
</li>
|
93
|
+
|
94
|
+
|
95
|
+
<li class="odd ">
|
96
|
+
<div class="item">
|
97
|
+
<span class='object_link'><a href="DLLModule/DLL.html#extract_head-instance_method" title="DLLModule::DLL#extract_head (method)">#extract_head</a></span>
|
98
|
+
<small>DLLModule::DLL</small>
|
99
|
+
</div>
|
100
|
+
</li>
|
101
|
+
|
102
|
+
|
103
|
+
<li class="even ">
|
104
|
+
<div class="item">
|
105
|
+
<span class='object_link'><a href="DLLModule/DLL.html#extract_tail-instance_method" title="DLLModule::DLL#extract_tail (method)">#extract_tail</a></span>
|
106
|
+
<small>DLLModule::DLL</small>
|
107
|
+
</div>
|
108
|
+
</li>
|
109
|
+
|
110
|
+
|
111
|
+
<li class="odd ">
|
112
|
+
<div class="item">
|
113
|
+
<span class='object_link'><a href="DLLModule/DLL.html#get_head-instance_method" title="DLLModule::DLL#get_head (method)">#get_head</a></span>
|
114
|
+
<small>DLLModule::DLL</small>
|
115
|
+
</div>
|
116
|
+
</li>
|
117
|
+
|
118
|
+
|
119
|
+
<li class="even ">
|
120
|
+
<div class="item">
|
121
|
+
<span class='object_link'><a href="DLLModule/DLL.html#get_tail-instance_method" title="DLLModule::DLL#get_tail (method)">#get_tail</a></span>
|
122
|
+
<small>DLLModule::DLL</small>
|
123
|
+
</div>
|
124
|
+
</li>
|
125
|
+
|
126
|
+
|
127
|
+
<li class="odd ">
|
128
|
+
<div class="item">
|
129
|
+
<span class='object_link'><a href="FoodAbstract.html#glucid_quantity-instance_method" title="FoodAbstract#glucid_quantity (method)">#glucid_quantity</a></span>
|
130
|
+
<small>FoodAbstract</small>
|
131
|
+
</div>
|
132
|
+
</li>
|
133
|
+
|
134
|
+
|
135
|
+
<li class="even ">
|
136
|
+
<div class="item">
|
137
|
+
<span class='object_link'><a href="Food.html#group_name-instance_method" title="Food#group_name (method)">#group_name</a></span>
|
138
|
+
<small>Food</small>
|
139
|
+
</div>
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="odd ">
|
144
|
+
<div class="item">
|
145
|
+
<span class='object_link'><a href="DLLModule/DLL.html#initialize-instance_method" title="DLLModule::DLL#initialize (method)">#initialize</a></span>
|
146
|
+
<small>DLLModule::DLL</small>
|
147
|
+
</div>
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
<li class="even ">
|
152
|
+
<div class="item">
|
153
|
+
<span class='object_link'><a href="FoodAbstract.html#initialize-instance_method" title="FoodAbstract#initialize (method)">#initialize</a></span>
|
154
|
+
<small>FoodAbstract</small>
|
155
|
+
</div>
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="odd ">
|
160
|
+
<div class="item">
|
161
|
+
<span class='object_link'><a href="Food.html#initialize-instance_method" title="Food#initialize (method)">#initialize</a></span>
|
162
|
+
<small>Food</small>
|
163
|
+
</div>
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="even ">
|
168
|
+
<div class="item">
|
169
|
+
<span class='object_link'><a href="DLLModule/DLL.html#insert_head-instance_method" title="DLLModule::DLL#insert_head (method)">#insert_head</a></span>
|
170
|
+
<small>DLLModule::DLL</small>
|
171
|
+
</div>
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
<li class="odd ">
|
176
|
+
<div class="item">
|
177
|
+
<span class='object_link'><a href="DLLModule/DLL.html#insert_tail-instance_method" title="DLLModule::DLL#insert_tail (method)">#insert_tail</a></span>
|
178
|
+
<small>DLLModule::DLL</small>
|
179
|
+
</div>
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
<li class="even ">
|
184
|
+
<div class="item">
|
185
|
+
<span class='object_link'><a href="FoodAbstract.html#lipid_quantity-instance_method" title="FoodAbstract#lipid_quantity (method)">#lipid_quantity</a></span>
|
186
|
+
<small>FoodAbstract</small>
|
187
|
+
</div>
|
188
|
+
</li>
|
189
|
+
|
190
|
+
|
191
|
+
<li class="odd ">
|
192
|
+
<div class="item">
|
193
|
+
<span class='object_link'><a href="FoodAbstract.html#name-instance_method" title="FoodAbstract#name (method)">#name</a></span>
|
194
|
+
<small>FoodAbstract</small>
|
195
|
+
</div>
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
<li class="even ">
|
200
|
+
<div class="item">
|
201
|
+
<span class='object_link'><a href="DLLModule/Node.html#next-instance_method" title="DLLModule::Node#next (method)">#next</a></span>
|
202
|
+
<small>DLLModule::Node</small>
|
203
|
+
</div>
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
<li class="odd ">
|
208
|
+
<div class="item">
|
209
|
+
<span class='object_link'><a href="DLLModule/Node.html#prev-instance_method" title="DLLModule::Node#prev (method)">#prev</a></span>
|
210
|
+
<small>DLLModule::Node</small>
|
211
|
+
</div>
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
<li class="even ">
|
216
|
+
<div class="item">
|
217
|
+
<span class='object_link'><a href="FoodAbstract.html#protein_quantity-instance_method" title="FoodAbstract#protein_quantity (method)">#protein_quantity</a></span>
|
218
|
+
<small>FoodAbstract</small>
|
219
|
+
</div>
|
220
|
+
</li>
|
221
|
+
|
222
|
+
|
223
|
+
<li class="odd ">
|
224
|
+
<div class="item">
|
225
|
+
<span class='object_link'><a href="top-level-namespace.html#read_data-instance_method" title="#read_data (method)">#read_data</a></span>
|
226
|
+
<small>Top Level Namespace</small>
|
227
|
+
</div>
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="even ">
|
232
|
+
<div class="item">
|
233
|
+
<span class='object_link'><a href="DLLModule/DLL.html#size-instance_method" title="DLLModule::DLL#size (method)">#size</a></span>
|
234
|
+
<small>DLLModule::DLL</small>
|
235
|
+
</div>
|
236
|
+
</li>
|
237
|
+
|
238
|
+
|
239
|
+
<li class="odd ">
|
240
|
+
<div class="item">
|
241
|
+
<span class='object_link'><a href="FoodAbstract.html#to_s-instance_method" title="FoodAbstract#to_s (method)">#to_s</a></span>
|
242
|
+
<small>FoodAbstract</small>
|
243
|
+
</div>
|
244
|
+
</li>
|
245
|
+
|
246
|
+
|
247
|
+
<li class="even ">
|
248
|
+
<div class="item">
|
249
|
+
<span class='object_link'><a href="Food.html#to_s-instance_method" title="Food#to_s (method)">#to_s</a></span>
|
250
|
+
<small>Food</small>
|
251
|
+
</div>
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="odd ">
|
256
|
+
<div class="item">
|
257
|
+
<span class='object_link'><a href="DLLModule/Node.html#value-instance_method" title="DLLModule::Node#value (method)">#value</a></span>
|
258
|
+
<small>DLLModule::Node</small>
|
259
|
+
</div>
|
260
|
+
</li>
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
</ul>
|
265
|
+
</div>
|
266
|
+
</body>
|
267
|
+
</html>
|
@@ -0,0 +1,297 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Top Level Namespace
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Top Level Namespace</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Top Level Namespace
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<h2>Defined Under Namespace</h2>
|
82
|
+
<p class="children">
|
83
|
+
|
84
|
+
|
85
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="DLLModule.html" title="DLLModule (module)">DLLModule</a></span>, <span class='object_link'><a href="FoodGem.html" title="FoodGem (module)">FoodGem</a></span>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span>, <span class='object_link'><a href="FoodAbstract.html" title="FoodAbstract (class)">FoodAbstract</a></span>
|
90
|
+
|
91
|
+
|
92
|
+
</p>
|
93
|
+
|
94
|
+
<h2>Constant Summary</h2>
|
95
|
+
<dl class="constants">
|
96
|
+
|
97
|
+
<dt id="PROTEIN_ENERGY-constant" class="">PROTEIN_ENERGY =
|
98
|
+
<div class="docstring">
|
99
|
+
<div class="discussion">
|
100
|
+
|
101
|
+
<p>Constants of energy</p>
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
</div>
|
106
|
+
<div class="tags">
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</dt>
|
111
|
+
<dd><pre class="code"><span class='int'>4</span></pre></dd>
|
112
|
+
|
113
|
+
<dt id="GLUCID_ENERGY-constant" class="">GLUCID_ENERGY =
|
114
|
+
|
115
|
+
</dt>
|
116
|
+
<dd><pre class="code"><span class='int'>4</span></pre></dd>
|
117
|
+
|
118
|
+
<dt id="LIPID_ENERGY-constant" class="">LIPID_ENERGY =
|
119
|
+
|
120
|
+
</dt>
|
121
|
+
<dd><pre class="code"><span class='int'>9</span></pre></dd>
|
122
|
+
|
123
|
+
</dl>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<h2>
|
133
|
+
Instance Method Summary
|
134
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
135
|
+
</h2>
|
136
|
+
|
137
|
+
<ul class="summary">
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="top-level-namespace.html#read_data-instance_method" title="#read_data (instance method)">#<strong>read_data</strong>(data_filename) ⇒ Array </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'>
|
157
|
+
<p>Method to read data by file.</p>
|
158
|
+
</div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
</ul>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
<div id="instance_method_details" class="method_details_list">
|
169
|
+
<h2>Instance Method Details</h2>
|
170
|
+
|
171
|
+
|
172
|
+
<div class="method_details first">
|
173
|
+
<h3 class="signature first" id="read_data-instance_method">
|
174
|
+
|
175
|
+
#<strong>read_data</strong>(data_filename) ⇒ <tt>Array</tt>
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
</h3><div class="docstring">
|
182
|
+
<div class="discussion">
|
183
|
+
|
184
|
+
<p>Method to read data by file</p>
|
185
|
+
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
<div class="tags">
|
190
|
+
|
191
|
+
<p class="tag_title">Returns:</p>
|
192
|
+
<ul class="return">
|
193
|
+
|
194
|
+
<li>
|
195
|
+
|
196
|
+
|
197
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
—
|
202
|
+
<div class='inline'>
|
203
|
+
<p>Return array of food</p>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
</div><table class="source_code">
|
211
|
+
<tr>
|
212
|
+
<td>
|
213
|
+
<pre class="lines">
|
214
|
+
|
215
|
+
|
216
|
+
99
|
217
|
+
100
|
218
|
+
101
|
219
|
+
102
|
220
|
+
103
|
221
|
+
104
|
222
|
+
105
|
223
|
+
106
|
224
|
+
107
|
225
|
+
108
|
226
|
+
109
|
227
|
+
110
|
228
|
+
111
|
229
|
+
112
|
230
|
+
113
|
231
|
+
114
|
232
|
+
115
|
233
|
+
116
|
234
|
+
117
|
235
|
+
118
|
236
|
+
119
|
237
|
+
120
|
238
|
+
121
|
239
|
+
122
|
240
|
+
123
|
241
|
+
124
|
242
|
+
125
|
243
|
+
126
|
244
|
+
127
|
245
|
+
128</pre>
|
246
|
+
</td>
|
247
|
+
<td>
|
248
|
+
<pre class="code"><span class="info file"># File 'lib/food/food_class.rb', line 99</span>
|
249
|
+
|
250
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_read_data'>read_data</span> <span class='lparen'>(</span><span class='id identifier rubyid_data_filename'>data_filename</span><span class='rparen'>)</span>
|
251
|
+
<span class='id identifier rubyid_data_string'>data_string</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_open'>open</span><span class='lparen'>(</span><span class='id identifier rubyid_data_filename'>data_filename</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>\n</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'># Divido el fichero en string de lineas
|
252
|
+
</span><span class='id identifier rubyid_food_array'>food_array</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
253
|
+
|
254
|
+
<span class='id identifier rubyid_data_string'>data_string</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_data_line'>data_line</span><span class='op'>|</span>
|
255
|
+
<span class='id identifier rubyid_data_line'>data_line</span> <span class='op'>=</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='comment'># La divido en espacios
|
256
|
+
</span> <span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
257
|
+
|
258
|
+
<span class='kw'>while</span> <span class='lparen'>(</span><span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span> <span class='comment'># Si el nombre no cambia al pasar de string afloat es que es un float
|
259
|
+
</span> <span class='id identifier rubyid_name'>name</span> <span class='op'><<</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
260
|
+
<span class='id identifier rubyid_data_line'>data_line</span> <span class='op'>=</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='comment'># Quito el primer elemento
|
261
|
+
</span> <span class='kw'>end</span>
|
262
|
+
|
263
|
+
<span class='id identifier rubyid_protein'>protein</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#PROTEIN_ENERGY-constant" title="PROTEIN_ENERGY (constant)">PROTEIN_ENERGY</a></span></span><span class='rbracket'>]</span>
|
264
|
+
<span class='id identifier rubyid_glucid'>glucid</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#GLUCID_ENERGY-constant" title="GLUCID_ENERGY (constant)">GLUCID_ENERGY</a></span></span><span class='rbracket'>]</span>
|
265
|
+
<span class='id identifier rubyid_lipid'>lipid</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_f'>to_f</span><span class='comma'>,</span> <span class='const'><span class='object_link'><a href="#LIPID_ENERGY-constant" title="LIPID_ENERGY (constant)">LIPID_ENERGY</a></span></span><span class='rbracket'>]</span>
|
266
|
+
|
267
|
+
<span class='id identifier rubyid_data_line'>data_line</span> <span class='op'>=</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>3</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span>
|
268
|
+
|
269
|
+
<span class='id identifier rubyid_group_name'>group_name</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
270
|
+
<span class='kw'>while</span> <span class='lparen'>(</span><span class='op'>!</span><span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span><span class='rparen'>)</span> <span class='comment'># Si el nombre no cambia al pasar de string afloat es que es un float
|
271
|
+
</span> <span class='id identifier rubyid_group_name'>group_name</span> <span class='op'><<</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span> <span class='op'><<</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> </span><span class='tstring_end'>"</span></span>
|
272
|
+
<span class='id identifier rubyid_data_line'>data_line</span> <span class='op'>=</span> <span class='id identifier rubyid_data_line'>data_line</span><span class='lbracket'>[</span><span class='int'>1</span><span class='op'>..</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='comment'># Quito el primer elemento
|
273
|
+
</span> <span class='kw'>end</span>
|
274
|
+
|
275
|
+
<span class='id identifier rubyid_food_array'>food_array</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="Food.html" title="Food (class)">Food</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Food.html#initialize-instance_method" title="Food#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_protein'>protein</span><span class='comma'>,</span> <span class='id identifier rubyid_glucid'>glucid</span><span class='comma'>,</span> <span class='id identifier rubyid_lipid'>lipid</span><span class='comma'>,</span> <span class='id identifier rubyid_group_name'>group_name</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>..</span><span class='op'>-</span><span class='int'>2</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='comment'># Quito último espacio a nombre y grupo
|
276
|
+
</span><span class='rbrace'>}</span>
|
277
|
+
|
278
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_food_array'>food_array</span>
|
279
|
+
<span class='kw'>end</span></pre>
|
280
|
+
</td>
|
281
|
+
</tr>
|
282
|
+
</table>
|
283
|
+
</div>
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
</div>
|
288
|
+
|
289
|
+
<div id="footer">
|
290
|
+
Generated on Wed Nov 15 11:48:20 2017 by
|
291
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
292
|
+
0.9.9 (ruby-2.3.0).
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
</body>
|
297
|
+
</html>
|
data/food.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "food"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "foodAIHE"
|
8
|
+
spec.version = FoodGem::VERSION
|
9
|
+
spec.authors = ["Angel Igareta"]
|
10
|
+
spec.email = ["alu0100967111@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Practica dessarrollada dirigida a pruebas TDD.}
|
13
|
+
spec.description = %q{Practica dessarrollada dirigida a pruebas TDD.}
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1718/tdd-alu0100967111"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata["allowed_push_host"] = "http://mygemserver.com"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
# "public gem pushes."
|
24
|
+
# end
|
25
|
+
|
26
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
|
+
f.match(%r{^(test|spec|features)/})
|
28
|
+
end
|
29
|
+
spec.bindir = "exe"
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
|
+
spec.require_paths = ["lib"]
|
32
|
+
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
|
37
|
+
spec.add_development_dependency "guard"
|
38
|
+
spec.add_development_dependency "guard-rspec"
|
39
|
+
spec.add_development_dependency "guard-bundler"
|
40
|
+
|
41
|
+
end
|