generatediet 0.0.2 → 0.0.3
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/Intermediate_diet_gain.rb +3 -1
- data/lib/Intermediate_diet_loss.rb +3 -1
- data/lib/diet.rb +4 -0
- data/lib/intensive_diet_gain.rb +3 -1
- data/lib/intensive_diet_loss.rb +3 -1
- data/lib/regular_diet_gain.rb +3 -1
- data/lib/regular_diet_loss.rb +3 -1
- metadata +2 -2
- data/lib/dietplanner.rb +0 -157
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed2dd61a41000d1b32844f3747fcc0e72337c94477dad8f29985120e1b30024a
|
4
|
+
data.tar.gz: 6421b460bc5564fd0b30234d91fcaaf21a9733805f359d4fb60844d994ae106a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 333db3e7af1fd335bb0a68613ffc372db574765f32c26dea0cf354f34e2427783968adfeabecbf4170e419fa475c1c001327bc58f10ce0024fab548998d9dbea
|
7
|
+
data.tar.gz: cade3301af42a62972eac684ef470437b71a7e9f4744f33613b235c71c418dbea85bc155d0f426ba2fd56810e36bec9ec0e2ae7997d0acef8f37263371055280
|
data/lib/diet.rb
ADDED
data/lib/intensive_diet_gain.rb
CHANGED
data/lib/intensive_diet_loss.rb
CHANGED
data/lib/regular_diet_gain.rb
CHANGED
data/lib/regular_diet_loss.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generatediet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bimbo Ogungbe
|
@@ -18,7 +18,7 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- lib/Intermediate_diet_gain.rb
|
20
20
|
- lib/Intermediate_diet_loss.rb
|
21
|
-
- lib/
|
21
|
+
- lib/diet.rb
|
22
22
|
- lib/generate.rb
|
23
23
|
- lib/intensive_diet_gain.rb
|
24
24
|
- lib/intensive_diet_loss.rb
|
data/lib/dietplanner.rb
DELETED
@@ -1,157 +0,0 @@
|
|
1
|
-
class DietPlanner
|
2
|
-
def initialize(initial_weight, target_weight, date_started, time_interval, daily_calories)
|
3
|
-
@initial_weight = initial_weight
|
4
|
-
@target_weight = target_weight
|
5
|
-
@date_started = date_started
|
6
|
-
end
|
7
|
-
# getter method for current weight
|
8
|
-
def initial_weight
|
9
|
-
@initial_weight
|
10
|
-
end
|
11
|
-
# getter method for target weight
|
12
|
-
def target_weight
|
13
|
-
@target_weight
|
14
|
-
end
|
15
|
-
|
16
|
-
# getter method for date started
|
17
|
-
def date_started
|
18
|
-
@date_started
|
19
|
-
end
|
20
|
-
|
21
|
-
# getter method for time interval
|
22
|
-
def time_interval
|
23
|
-
@time_interval
|
24
|
-
end
|
25
|
-
|
26
|
-
# getter method for daily calories
|
27
|
-
def daily_calories
|
28
|
-
@daily_calories
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
# decorator class -- this serves as the superclass for all the concrete decorators
|
33
|
-
|
34
|
-
class DietDecorator
|
35
|
-
def initialize(dietplanner)
|
36
|
-
@dietplanner= dietplanner
|
37
|
-
@intensive_diet_loss = null
|
38
|
-
@intensive_diet_gain = null
|
39
|
-
@intermediate_diet_loss = null
|
40
|
-
@intermediate_diet_gain = null
|
41
|
-
@regular_diet_loss - null
|
42
|
-
@Regular_diet_gain = null
|
43
|
-
|
44
|
-
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
|
49
|
-
class Intensive_diet_loss
|
50
|
-
def initialize(diet)
|
51
|
-
@intensive_diet_loss = diet
|
52
|
-
end
|
53
|
-
#generate diet method
|
54
|
-
def generate_diet
|
55
|
-
@hash = Hash.new
|
56
|
-
@hash.store("diet_type","intensive_diet_loss")
|
57
|
-
@hash.store("time_interval","30days")
|
58
|
-
@hash.store("date_started", @intensive_diet_loss.date_started)
|
59
|
-
@hash.store("initial_weight",@intensive_diet_loss.initial_weight)
|
60
|
-
@hash.store("target_weight",@intensive_diet_loss.target_weight)
|
61
|
-
@hash.store("daily_calories",1300)
|
62
|
-
@hash
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
class Intensive_diet_gain
|
67
|
-
def initialize(diet)
|
68
|
-
@intensive_diet_gain = diet
|
69
|
-
end
|
70
|
-
|
71
|
-
#generate diet method
|
72
|
-
def generate_diet
|
73
|
-
@hash = Hash.new
|
74
|
-
@hash.store("diet_type","intensive_diet_gain")
|
75
|
-
@hash.store("time_interval","30days")
|
76
|
-
@hash.store("date_started",@intensive_diet_gain.date_started)
|
77
|
-
@hash.store("initial_weight",@intensive_diet_gain.initial_weight)
|
78
|
-
@hash.store("target_weight",@intensive_diet_gain.target_weight)
|
79
|
-
@hash.store("daily_calories",1800)
|
80
|
-
@hash
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
|
85
|
-
class Intermediate_diet_loss
|
86
|
-
def initialize(diet)
|
87
|
-
@intermediate_diet_loss = diet
|
88
|
-
end
|
89
|
-
|
90
|
-
#generate diet method
|
91
|
-
def generate_diet
|
92
|
-
@hash = Hash.new
|
93
|
-
@hash.store("diet_type","intermediate_diet_loss")
|
94
|
-
@hash.store("time_interval","60days")
|
95
|
-
@hash.store("date_started",@intermediate_diet_loss.date_started)
|
96
|
-
@hash.store("initial_weight",@intermediate_diet_loss.initial_weight)
|
97
|
-
@hash.store("target_weight",@intermediate_diet_loss.target_weight)
|
98
|
-
@hash.store("daily_calories",1200)
|
99
|
-
@hash
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
class Intermediate_diet_gain
|
104
|
-
def initialize(diet)
|
105
|
-
@intermediate_diet_gain = diet
|
106
|
-
end
|
107
|
-
#generate diet method
|
108
|
-
def generate_diet
|
109
|
-
@hash = Hash.new
|
110
|
-
@hash.store("diet_type","intermediate_diet_gain")
|
111
|
-
@hash.store("time_interval","60days")
|
112
|
-
@hash.store("date_started",@intermediate_diet_gain.date_started)
|
113
|
-
@hash.store("initial_weight",@intermediate_diet_gain.initial_weight)
|
114
|
-
@hash.store("target_weight",@intermediate_diet_gain.target_weight)
|
115
|
-
@hash.store("daily_calories",1500)
|
116
|
-
@hash
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
120
|
-
|
121
|
-
|
122
|
-
class Regular_diet_loss
|
123
|
-
def initialize(diet)
|
124
|
-
@regular_diet_loss= diet
|
125
|
-
end
|
126
|
-
#generate diet method
|
127
|
-
def generate_diet
|
128
|
-
@hash = Hash.new
|
129
|
-
@hash.store("diet_type","regular_diet_loss")
|
130
|
-
@hash.store("time_interval","90days")
|
131
|
-
@hash.store("date_started",@regular_diet_loss.date_started)
|
132
|
-
@hash.store("initial_weight",@regular_diet_loss.initial_weight)
|
133
|
-
@hash.store("target_weight",@regular_diet_loss.target_weight)
|
134
|
-
@hash.store("daily_calories",1300)
|
135
|
-
@hash
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
class Regular_diet_gain
|
140
|
-
|
141
|
-
def initialize(diet)
|
142
|
-
@regular_diet_gain = diet
|
143
|
-
end
|
144
|
-
|
145
|
-
#generate diet method
|
146
|
-
def generate_diet
|
147
|
-
@hash = Hash.new
|
148
|
-
@hash.store("diet_type","regular_diet_gain")
|
149
|
-
@hash.store("time_interval","90days")
|
150
|
-
@hash.store("date_started",@regular_diet_gain.date_started)
|
151
|
-
@hash.store("initial_weight",@regular_diet_gain.initial_weight)
|
152
|
-
@hash.store("target_weight",@regular_diet_gain.target_weight)
|
153
|
-
@hash.store("daily_calories",1800)
|
154
|
-
@hash
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|