prct11_edu 0.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 +9 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +21 -0
- data/Rakefile~ +21 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/documentation/Dieta.html +1091 -0
- data/documentation/DietaEdad.html +299 -0
- data/documentation/DietaTipo.html +237 -0
- data/documentation/Lista.html +740 -0
- data/documentation/Nodo.html +400 -0
- data/documentation/Prct06.html +117 -0
- data/documentation/Receta.html +107 -0
- data/documentation/_index.html +171 -0
- data/documentation/class_list.html +51 -0
- data/documentation/css/common.css +1 -0
- data/documentation/css/full_list.css +58 -0
- data/documentation/css/style.css +481 -0
- data/documentation/file.README.html +128 -0
- data/documentation/file_list.html +56 -0
- data/documentation/frames.html +17 -0
- data/documentation/index.html +128 -0
- data/documentation/js/app.js +243 -0
- data/documentation/js/full_list.js +216 -0
- data/documentation/js/jquery.js +4 -0
- data/documentation/method_list.html +267 -0
- data/documentation/top-level-namespace.html +114 -0
- data/lib/prct06.rb +4 -0
- data/lib/prct06/.swp +0 -0
- data/lib/prct06/dieta.rb +61 -0
- data/lib/prct06/lista.rb +61 -0
- data/lib/prct06/lista.rb~ +29 -0
- data/lib/prct06/version.rb +3 -0
- data/prct06.gemspec +36 -0
- data/prct06.gemspec~ +36 -0
- metadata +126 -0
@@ -0,0 +1,114 @@
|
|
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.5
|
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"></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
|
+
<iframe id="search_frame" src="class_list.html"></iframe>
|
63
|
+
|
64
|
+
<div id="content"><h1>Top Level Namespace
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
</h1>
|
69
|
+
<div class="box_info">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
</div>
|
82
|
+
|
83
|
+
<h2>Defined Under Namespace</h2>
|
84
|
+
<p class="children">
|
85
|
+
|
86
|
+
|
87
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Prct06.html" title="Prct06 (module)">Prct06</a></span>, <span class='object_link'><a href="Receta.html" title="Receta (module)">Receta</a></span>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Dieta.html" title="Dieta (class)">Dieta</a></span>, <span class='object_link'><a href="DietaEdad.html" title="DietaEdad (class)">DietaEdad</a></span>, <span class='object_link'><a href="DietaTipo.html" title="DietaTipo (class)">DietaTipo</a></span>, <span class='object_link'><a href="Lista.html" title="Lista (class)">Lista</a></span>, <span class='object_link'><a href="Nodo.html" title="Nodo (class)">Nodo</a></span>
|
92
|
+
|
93
|
+
|
94
|
+
</p>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div id="footer">
|
107
|
+
Generated on Tue Nov 22 09:11:06 2016 by
|
108
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
109
|
+
0.9.5 (ruby-2.3.0).
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
</body>
|
114
|
+
</html>
|
data/lib/prct06.rb
ADDED
data/lib/prct06/.swp
ADDED
Binary file
|
data/lib/prct06/dieta.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#Author: Eduardo de la Paz González
|
2
|
+
|
3
|
+
|
4
|
+
require "prct06/version"
|
5
|
+
|
6
|
+
class Dieta
|
7
|
+
#accessor para cada variable
|
8
|
+
attr_accessor :nombre, :title, :ingestas, :platos, :porcentajes
|
9
|
+
|
10
|
+
def initialize(nombre,&block)
|
11
|
+
self.nombre = nombre
|
12
|
+
self.title = ""
|
13
|
+
self.ingestas = []
|
14
|
+
self.platos =[]
|
15
|
+
self.porcentajes = []
|
16
|
+
if block_given?
|
17
|
+
if block.arity == 1
|
18
|
+
yield self
|
19
|
+
else
|
20
|
+
instance_eval(&block)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
#Definición del método to_s para mostrar el menú por pantalla
|
26
|
+
#def to_s
|
27
|
+
# mostrar = ""
|
28
|
+
# mostrar << "\n\n#{nombre} (#{ingestas.join(', ')} %)\n"
|
29
|
+
# for i in 0..(@conjplatos-1)
|
30
|
+
# mostrar << "- #{@descripcion[i]}, #{@porciones[i]}, #{@ingengr[i]}\n"
|
31
|
+
# end
|
32
|
+
# mostrar << "V.C.T | % #{@porcentajes[0]} kcal | #{@porcentajes[1]}% - #{@porcentajes[2]}% - #{@porcentajes[3]}%\n"
|
33
|
+
#end
|
34
|
+
|
35
|
+
def titulo(name_)
|
36
|
+
self.title= name_
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
def ingesta (opciones = {})
|
41
|
+
ingestas << "(#{opciones[:min]})" if opciones[:min]
|
42
|
+
ingestas << "(#{opciones[:max]})" if opciones[:max]
|
43
|
+
end
|
44
|
+
|
45
|
+
def plato (opciones = {})
|
46
|
+
plat = "(#{opciones[:descripcion]})" if opciones[:descripcion]
|
47
|
+
plat << "(#{opciones[:porciones]})" if opciones[:porciones]
|
48
|
+
plat << "(#{opciones[:gramos]})" if opciones[:gramos]
|
49
|
+
platos << plat
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
def porcentaje (opciones = {})
|
54
|
+
porcentajes << "(#{opciones[:vct]})" if opciones[:vct]
|
55
|
+
porcentajes << "(#{opciones[:proteinas]})" if opciones[:proteinas]
|
56
|
+
porcentajes << "(#{opciones[:grasas]})" if opciones[:grasas]
|
57
|
+
porcentajes << "(#{opciones[:hidratos]})" if opciones[:hidratos]
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
data/lib/prct06/lista.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
#Author: Eduardo de la Paz González
|
2
|
+
|
3
|
+
require "prct06/version"
|
4
|
+
Nodo = Struct.new(:value, :next, :prev)
|
5
|
+
|
6
|
+
class Lista
|
7
|
+
#Reader y writer para cada variable
|
8
|
+
attr_reader :tail, :beginning
|
9
|
+
attr_writer :tail, :beginning
|
10
|
+
#Se incluye Enumerable
|
11
|
+
include Enumerable
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@beginning = @tail = nil
|
15
|
+
end
|
16
|
+
#Método add para añadir un nodo a la lista
|
17
|
+
def add (valor)
|
18
|
+
nodo = Nodo.new(valor)
|
19
|
+
|
20
|
+
@beginning = nodo if @beginning.nil?
|
21
|
+
|
22
|
+
@tail.next = nodo unless @tail.nil?
|
23
|
+
nodo.prev = @tail unless @tail.nil?
|
24
|
+
@tail = nodo
|
25
|
+
end
|
26
|
+
#Método pop para sacar un elemento por el principio
|
27
|
+
def pop
|
28
|
+
aux = @beginning
|
29
|
+
@beginning = @beginning.next
|
30
|
+
aux
|
31
|
+
|
32
|
+
end
|
33
|
+
#Método size que devuelve el tamaño de la lista
|
34
|
+
def size
|
35
|
+
size = 0
|
36
|
+
$i = @beginning
|
37
|
+
while $i != nil do
|
38
|
+
size = size + 1
|
39
|
+
$i = $i.next
|
40
|
+
end
|
41
|
+
size
|
42
|
+
end
|
43
|
+
#Definición de to_s para mostrar la lista por pantalla
|
44
|
+
def to_s
|
45
|
+
$i = @beginning
|
46
|
+
while $i != nil do
|
47
|
+
mostrar = ""
|
48
|
+
puts "#{$i.value}"
|
49
|
+
$i = $i.next
|
50
|
+
end
|
51
|
+
end
|
52
|
+
#Definición del each para Enumerable
|
53
|
+
def each
|
54
|
+
aux = @beginning
|
55
|
+
while aux != nil do
|
56
|
+
yield aux.value
|
57
|
+
aux = aux.next
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class Lista
|
2
|
+
def initialize
|
3
|
+
@beginning = @tail nil
|
4
|
+
end
|
5
|
+
|
6
|
+
def add (valor)
|
7
|
+
nodo = Nodo.new(valor)
|
8
|
+
|
9
|
+
@beginning = nodo if @beggining.nil?
|
10
|
+
|
11
|
+
@tail.next = node unless @tail.nil?
|
12
|
+
@tail = node
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
class Nodo
|
17
|
+
def initialize(value)
|
18
|
+
@valor = valor
|
19
|
+
@next = nil
|
20
|
+
end
|
21
|
+
|
22
|
+
def next
|
23
|
+
@next
|
24
|
+
end
|
25
|
+
|
26
|
+
def next=(valor)
|
27
|
+
@next = valor
|
28
|
+
end
|
29
|
+
end
|
data/prct06.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'prct06/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prct11_edu"
|
8
|
+
spec.version = Prct06::VERSION
|
9
|
+
spec.authors = ["Eduardo de la Paz González"]
|
10
|
+
spec.email = ["alu0100893267@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Proyecto de la clase Dieta en Ruby}
|
13
|
+
spec.description = %q{Practica 999999999 de Lenguajes y Paradigmas de la Programación}
|
14
|
+
spec.homepage = "https://github.com/ULL-ESIT-LPP-1617/menu-dietetico-alu0100893267"
|
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'] = "TODO: Set to '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.13"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
end
|
data/prct06.gemspec~
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'prct06/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "prct06"
|
8
|
+
spec.version = Prct06::VERSION
|
9
|
+
spec.authors = ["Sergio García"]
|
10
|
+
spec.email = ["alu0100892260@ull.edu.es"]
|
11
|
+
|
12
|
+
spec.summary = %q{Proyecto de la clase Dieta en Ruby}
|
13
|
+
spec.description = %q{Practica 6 de Lenguajes y Paradigmas de la Programación}
|
14
|
+
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
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'] = "TODO: Set to '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.13"
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: prct11_edu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Eduardo de la Paz González
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.13'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.13'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Practica 999999999 de Lenguajes y Paradigmas de la Programación
|
56
|
+
email:
|
57
|
+
- alu0100893267@ull.edu.es
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- CODE_OF_CONDUCT.md
|
66
|
+
- Gemfile
|
67
|
+
- LICENSE.txt
|
68
|
+
- README.md
|
69
|
+
- Rakefile
|
70
|
+
- Rakefile~
|
71
|
+
- bin/console
|
72
|
+
- bin/setup
|
73
|
+
- documentation/Dieta.html
|
74
|
+
- documentation/DietaEdad.html
|
75
|
+
- documentation/DietaTipo.html
|
76
|
+
- documentation/Lista.html
|
77
|
+
- documentation/Nodo.html
|
78
|
+
- documentation/Prct06.html
|
79
|
+
- documentation/Receta.html
|
80
|
+
- documentation/_index.html
|
81
|
+
- documentation/class_list.html
|
82
|
+
- documentation/css/common.css
|
83
|
+
- documentation/css/full_list.css
|
84
|
+
- documentation/css/style.css
|
85
|
+
- documentation/file.README.html
|
86
|
+
- documentation/file_list.html
|
87
|
+
- documentation/frames.html
|
88
|
+
- documentation/index.html
|
89
|
+
- documentation/js/app.js
|
90
|
+
- documentation/js/full_list.js
|
91
|
+
- documentation/js/jquery.js
|
92
|
+
- documentation/method_list.html
|
93
|
+
- documentation/top-level-namespace.html
|
94
|
+
- lib/prct06.rb
|
95
|
+
- lib/prct06/.swp
|
96
|
+
- lib/prct06/dieta.rb
|
97
|
+
- lib/prct06/lista.rb
|
98
|
+
- lib/prct06/lista.rb~
|
99
|
+
- lib/prct06/version.rb
|
100
|
+
- prct06.gemspec
|
101
|
+
- prct06.gemspec~
|
102
|
+
homepage: https://github.com/ULL-ESIT-LPP-1617/menu-dietetico-alu0100893267
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 2.5.1
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: Proyecto de la clase Dieta en Ruby
|
126
|
+
test_files: []
|