Dogeku 1.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/LICENSE +21 -0
- data/README.md +39 -0
- data/app/Historique/Action.rb +29 -0
- data/app/Historique/ChangerCase.rb +44 -0
- data/app/Historique/HistoriqueAction.rb +114 -0
- data/app/components/CaseDessin.rb +325 -0
- data/app/components/GrilleDessin.rb +235 -0
- data/app/components/Header.rb +194 -0
- data/app/config/app.yml +0 -0
- data/app/config/database.yml +2 -0
- data/app/controller/ApprentissageControleur.rb +75 -0
- data/app/controller/ChargerControleur.rb +41 -0
- data/app/controller/JeuLibreControleur.rb +244 -0
- data/app/controller/MenuControleur.rb +57 -0
- data/app/controller/NiveauControleur.rb +54 -0
- data/app/controller/NouvellePartieControleur.rb +34 -0
- data/app/controller/PrincipaleControleur.rb +30 -0
- data/app/controller/PseudoControleur.rb +95 -0
- data/app/controller/ReglagesControleur.rb +86 -0
- data/app/controller/ReglesControleur.rb +34 -0
- data/app/controller/ScoresControleur.rb +42 -0
- data/app/controller/StatistiquesControleur.rb +64 -0
- data/app/core/Conf.rb +26 -0
- data/app/core/Controller.rb +180 -0
- data/app/core/Core.rb +186 -0
- data/app/core/Model.rb +159 -0
- data/app/core/View.rb +56 -0
- data/app/db/main.sqlite3 +0 -0
- data/app/model/Configuration.rb +180 -0
- data/app/model/Grille.rb +180 -0
- data/app/model/Jeu.rb +74 -0
- data/app/model/Score.rb +100 -0
- data/app/model/Utilisateur.rb +113 -0
- data/app/utils/DSubset.rb +98 -0
- data/app/utils/Generateur.rb +171 -0
- data/app/utils/HPTriple.rb +75 -0
- data/app/utils/Peche.rb +46 -0
- data/app/utils/SCandidate.rb +86 -0
- data/app/utils/SCell.rb +73 -0
- data/app/utils/Technique.rb +202 -0
- data/app/utils/TechniqueUsine.rb +25 -0
- data/app/utils/XWing.rb +203 -0
- data/app/view/Fenetre.rb +424 -0
- data/app/view/FenetreApprentissage.rb +272 -0
- data/app/view/FenetreCharger.rb +31 -0
- data/app/view/FenetreJeuLibre.rb +468 -0
- data/app/view/FenetreMenu.rb +198 -0
- data/app/view/FenetreNiveau.rb +105 -0
- data/app/view/FenetreNouvellePartie.rb +92 -0
- data/app/view/FenetrePrincipale.rb +45 -0
- data/app/view/FenetrePseudo.rb +115 -0
- data/app/view/FenetreReglages.rb +209 -0
- data/app/view/FenetreRegles.rb +111 -0
- data/app/view/FenetreScores.rb +120 -0
- data/app/view/FenetreStatistiques.rb +134 -0
- data/assets/css/style.css +69 -0
- data/assets/img/eraser.png +0 -0
- data/assets/img/fond.jpg +0 -0
- data/assets/img/iconApp.png +0 -0
- data/assets/img/logoS.jpeg +0 -0
- data/assets/img/sudokuIntro.jpg +0 -0
- data/assets/img/user.png +0 -0
- data/bin/dogeku +19 -0
- data/doc/Action.html +309 -0
- data/doc/ApprentissageControleur.html +568 -0
- data/doc/CaseDessin.html +2405 -0
- data/doc/ChangerCase.html +405 -0
- data/doc/ChargerControleur.html +342 -0
- data/doc/Conf.html +378 -0
- data/doc/Configuration.html +1115 -0
- data/doc/Controller.html +1008 -0
- data/doc/Core.html +1191 -0
- data/doc/DSubset.html +647 -0
- data/doc/Fenetre.html +2631 -0
- data/doc/FenetreApprentissage.html +1175 -0
- data/doc/FenetreCharger.html +343 -0
- data/doc/FenetreJeuLibre.html +1859 -0
- data/doc/FenetreMenu.html +900 -0
- data/doc/FenetreNiveau.html +626 -0
- data/doc/FenetreNouvellePartie.html +602 -0
- data/doc/FenetrePrincipale.html +371 -0
- data/doc/FenetrePseudo.html +695 -0
- data/doc/FenetreReglages.html +946 -0
- data/doc/FenetreRegles.html +636 -0
- data/doc/FenetreScores.html +650 -0
- data/doc/FenetreStatistiques.html +672 -0
- data/doc/Generateur.html +1015 -0
- data/doc/Grille.html +1348 -0
- data/doc/GrilleDessin.html +1281 -0
- data/doc/HPTriple.html +593 -0
- data/doc/Header.html +1253 -0
- data/doc/HistoriqueAction.html +792 -0
- data/doc/Jeu.html +923 -0
- data/doc/JeuLibreControleur.html +1445 -0
- data/doc/MenuControleur.html +522 -0
- data/doc/Model.html +996 -0
- data/doc/NiveauControleur.html +451 -0
- data/doc/NouvellePartieControleur.html +330 -0
- data/doc/Peche.html +396 -0
- data/doc/PrincipaleControleur.html +320 -0
- data/doc/PseudoControleur.html +695 -0
- data/doc/ReglagesControleur.html +747 -0
- data/doc/ReglesControleur.html +330 -0
- data/doc/SCandidate.html +617 -0
- data/doc/SCell.html +587 -0
- data/doc/Score.html +926 -0
- data/doc/ScoresControleur.html +346 -0
- data/doc/StatistiquesControleur.html +390 -0
- data/doc/Technique.html +543 -0
- data/doc/TechniqueUsine.html +252 -0
- data/doc/Utilisateur.html +806 -0
- data/doc/View.html +844 -0
- data/doc/XWing.html +1031 -0
- data/doc/_index.html +478 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +492 -0
- data/doc/file.README.html +141 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +141 -0
- data/doc/js/app.js +243 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +2523 -0
- data/doc/top-level-namespace.html +112 -0
- data/test/Generateur/grilleCorrecte.rb +198 -0
- data/test/Model/scoreCorrecte.rb +55 -0
- data/test/Model/utilisateurCorrecte.rb +68 -0
- data/test/test_helper.rb +2 -0
- data/test/unitTest.rb +72 -0
- metadata +187 -0
data/doc/Controller.html
ADDED
|
@@ -0,0 +1,1008 @@
|
|
|
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
|
+
Class: Controller
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.9.8
|
|
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 = "Controller";
|
|
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 (C)</a> »
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<span class="title">Controller</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>Class: Controller
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Controller</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
<dl>
|
|
96
|
+
<dt>Defined in:</dt>
|
|
97
|
+
<dd>app/core/Controller.rb</dd>
|
|
98
|
+
</dl>
|
|
99
|
+
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
|
|
105
|
+
<p>Controls the data flow into an item object and updates the view whenever
|
|
106
|
+
data changes.</p>
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="tags">
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
</div><div id="subclasses">
|
|
115
|
+
<h2>Direct Known Subclasses</h2>
|
|
116
|
+
<p class="children"><span class='object_link'><a href="ApprentissageControleur.html" title="ApprentissageControleur (class)">ApprentissageControleur</a></span>, <span class='object_link'><a href="ChargerControleur.html" title="ChargerControleur (class)">ChargerControleur</a></span>, <span class='object_link'><a href="JeuLibreControleur.html" title="JeuLibreControleur (class)">JeuLibreControleur</a></span>, <span class='object_link'><a href="MenuControleur.html" title="MenuControleur (class)">MenuControleur</a></span>, <span class='object_link'><a href="NiveauControleur.html" title="NiveauControleur (class)">NiveauControleur</a></span>, <span class='object_link'><a href="NouvellePartieControleur.html" title="NouvellePartieControleur (class)">NouvellePartieControleur</a></span>, <span class='object_link'><a href="PrincipaleControleur.html" title="PrincipaleControleur (class)">PrincipaleControleur</a></span>, <span class='object_link'><a href="PseudoControleur.html" title="PseudoControleur (class)">PseudoControleur</a></span>, <span class='object_link'><a href="ReglagesControleur.html" title="ReglagesControleur (class)">ReglagesControleur</a></span>, <span class='object_link'><a href="ReglesControleur.html" title="ReglesControleur (class)">ReglesControleur</a></span>, <span class='object_link'><a href="ScoresControleur.html" title="ScoresControleur (class)">ScoresControleur</a></span>, <span class='object_link'><a href="StatistiquesControleur.html" title="StatistiquesControleur (class)">StatistiquesControleur</a></span></p>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<h2>
|
|
127
|
+
Class Method Summary
|
|
128
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
129
|
+
</h2>
|
|
130
|
+
|
|
131
|
+
<ul class="summary">
|
|
132
|
+
|
|
133
|
+
<li class="public ">
|
|
134
|
+
<span class="summary_signature">
|
|
135
|
+
|
|
136
|
+
<a href="#inherited-class_method" title="inherited (class method)">.<strong>inherited</strong>(subclass) ⇒ Object </a>
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</span>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<span class="summary_desc"><div class='inline'>
|
|
151
|
+
<p>Invoke methods when inherited.</p>
|
|
152
|
+
</div></span>
|
|
153
|
+
|
|
154
|
+
</li>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
</ul>
|
|
158
|
+
|
|
159
|
+
<h2>
|
|
160
|
+
Instance Method Summary
|
|
161
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
162
|
+
</h2>
|
|
163
|
+
|
|
164
|
+
<ul class="summary">
|
|
165
|
+
|
|
166
|
+
<li class="public ">
|
|
167
|
+
<span class="summary_signature">
|
|
168
|
+
|
|
169
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Controller </a>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
</span>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
<span class="note title constructor">constructor</span>
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
<span class="summary_desc"><div class='inline'>
|
|
186
|
+
<p>Initialisation.</p>
|
|
187
|
+
</div></span>
|
|
188
|
+
|
|
189
|
+
</li>
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<li class="public ">
|
|
193
|
+
<span class="summary_signature">
|
|
194
|
+
|
|
195
|
+
<a href="#loadFile-instance_method" title="#loadFile (instance method)">#<strong>loadFile</strong>(filePath, debugInfo) ⇒ Object </a>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
</span>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
<span class="summary_desc"><div class='inline'>
|
|
210
|
+
<p>Loads a file.</p>
|
|
211
|
+
</div></span>
|
|
212
|
+
|
|
213
|
+
</li>
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
<li class="public ">
|
|
217
|
+
<span class="summary_signature">
|
|
218
|
+
|
|
219
|
+
<a href="#loadModel-instance_method" title="#loadModel (instance method)">#<strong>loadModel</strong>(name) ⇒ Object </a>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
</span>
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
<span class="summary_desc"><div class='inline'>
|
|
234
|
+
<p>Loads a model.</p>
|
|
235
|
+
</div></span>
|
|
236
|
+
|
|
237
|
+
</li>
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
<li class="public ">
|
|
241
|
+
<span class="summary_signature">
|
|
242
|
+
|
|
243
|
+
<a href="#render-instance_method" title="#render (instance method)">#<strong>render</strong>(name, **args) ⇒ Object </a>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
</span>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
<span class="summary_desc"><div class='inline'>
|
|
258
|
+
<p>Render view called by controller.</p>
|
|
259
|
+
</div></span>
|
|
260
|
+
|
|
261
|
+
</li>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
<li class="public ">
|
|
265
|
+
<span class="summary_signature">
|
|
266
|
+
|
|
267
|
+
<a href="#run-instance_method" title="#run (instance method)">#<strong>run</strong> ⇒ Object </a>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
</span>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
<span class="summary_desc"><div class='inline'>
|
|
282
|
+
<p>Invoke all method in controller for collecting contents to send on view.</p>
|
|
283
|
+
</div></span>
|
|
284
|
+
|
|
285
|
+
</li>
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
<li class="public ">
|
|
289
|
+
<span class="summary_signature">
|
|
290
|
+
|
|
291
|
+
<a href="#set_properties-instance_method" title="#set_properties (instance method)">#<strong>set_properties</strong>(view) ⇒ Object </a>
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
</span>
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
<span class="summary_desc"><div class='inline'>
|
|
306
|
+
<p>Sets the properties of window.</p>
|
|
307
|
+
</div></span>
|
|
308
|
+
|
|
309
|
+
</li>
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
</ul>
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
<div id="constructor_details" class="method_details_list">
|
|
316
|
+
<h2>Constructor Details</h2>
|
|
317
|
+
|
|
318
|
+
<div class="method_details first">
|
|
319
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
320
|
+
|
|
321
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Controller (class)">Controller</a></span></tt>
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</h3><div class="docstring">
|
|
328
|
+
<div class="discussion">
|
|
329
|
+
|
|
330
|
+
<p>Initialisation</p>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
</div>
|
|
334
|
+
</div>
|
|
335
|
+
<div class="tags">
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
</div><table class="source_code">
|
|
339
|
+
<tr>
|
|
340
|
+
<td>
|
|
341
|
+
<pre class="lines">
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
13
|
|
345
|
+
14
|
|
346
|
+
15
|
|
347
|
+
16
|
|
348
|
+
17
|
|
349
|
+
18
|
|
350
|
+
19
|
|
351
|
+
20
|
|
352
|
+
21
|
|
353
|
+
22
|
|
354
|
+
23
|
|
355
|
+
24
|
|
356
|
+
25
|
|
357
|
+
26
|
|
358
|
+
27
|
|
359
|
+
28
|
|
360
|
+
29</pre>
|
|
361
|
+
</td>
|
|
362
|
+
<td>
|
|
363
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 13</span>
|
|
364
|
+
|
|
365
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='rparen'>)</span>
|
|
366
|
+
|
|
367
|
+
<span class='ivar'>@title</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>MyApp</span><span class='tstring_end'>"</span></span>
|
|
368
|
+
<span class='ivar'>@width</span> <span class='op'>=</span> <span class='int'>900</span>
|
|
369
|
+
<span class='ivar'>@height</span> <span class='op'>=</span> <span class='int'>500</span>
|
|
370
|
+
<span class='ivar'>@borderWidth</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
371
|
+
<span class='ivar'>@resizable</span> <span class='op'>=</span> <span class='kw'>true</span>
|
|
372
|
+
<span class='ivar'>@position</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>CENTER</span><span class='tstring_end'>"</span></span>
|
|
373
|
+
|
|
374
|
+
<span class='comment'>## Create content variable sent from controller to view called
|
|
375
|
+
</span> <span class='ivar'>@content</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='int'>0</span><span class='rparen'>)</span>
|
|
376
|
+
|
|
377
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#DEBUG-constant" title="Core::DEBUG (constant)">DEBUG</a></span></span>
|
|
378
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Main controller instanciation</span><span class='tstring_end'>"</span></span>
|
|
379
|
+
<span class='kw'>end</span>
|
|
380
|
+
|
|
381
|
+
<span class='kw'>end</span></pre>
|
|
382
|
+
</td>
|
|
383
|
+
</tr>
|
|
384
|
+
</table>
|
|
385
|
+
</div>
|
|
386
|
+
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
<div id="class_method_details" class="method_details_list">
|
|
391
|
+
<h2>Class Method Details</h2>
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
<div class="method_details first">
|
|
395
|
+
<h3 class="signature first" id="inherited-class_method">
|
|
396
|
+
|
|
397
|
+
.<strong>inherited</strong>(subclass) ⇒ <tt>Object</tt>
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
</h3><div class="docstring">
|
|
404
|
+
<div class="discussion">
|
|
405
|
+
|
|
406
|
+
<p>Invoke methods when inherited</p>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
</div>
|
|
410
|
+
</div>
|
|
411
|
+
<div class="tags">
|
|
412
|
+
<p class="tag_title">Parameters:</p>
|
|
413
|
+
<ul class="param">
|
|
414
|
+
|
|
415
|
+
<li>
|
|
416
|
+
|
|
417
|
+
<span class='name'>subclass</span>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
<span class='type'></span>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
—
|
|
425
|
+
<div class='inline'>
|
|
426
|
+
<p>The subclass</p>
|
|
427
|
+
</div>
|
|
428
|
+
|
|
429
|
+
</li>
|
|
430
|
+
|
|
431
|
+
</ul>
|
|
432
|
+
|
|
433
|
+
<p class="tag_title">Returns:</p>
|
|
434
|
+
<ul class="return">
|
|
435
|
+
|
|
436
|
+
<li>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
<span class='type'></span>
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
<div class='inline'>
|
|
445
|
+
<p>Itself</p>
|
|
446
|
+
</div>
|
|
447
|
+
|
|
448
|
+
</li>
|
|
449
|
+
|
|
450
|
+
</ul>
|
|
451
|
+
|
|
452
|
+
</div><table class="source_code">
|
|
453
|
+
<tr>
|
|
454
|
+
<td>
|
|
455
|
+
<pre class="lines">
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
38
|
|
459
|
+
39
|
|
460
|
+
40
|
|
461
|
+
41
|
|
462
|
+
42</pre>
|
|
463
|
+
</td>
|
|
464
|
+
<td>
|
|
465
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 38</span>
|
|
466
|
+
|
|
467
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_inherited'>inherited</span><span class='lparen'>(</span><span class='id identifier rubyid_subclass'>subclass</span><span class='rparen'>)</span>
|
|
468
|
+
<span class='kw'>super</span>
|
|
469
|
+
|
|
470
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
|
471
|
+
<span class='kw'>end</span></pre>
|
|
472
|
+
</td>
|
|
473
|
+
</tr>
|
|
474
|
+
</table>
|
|
475
|
+
</div>
|
|
476
|
+
|
|
477
|
+
</div>
|
|
478
|
+
|
|
479
|
+
<div id="instance_method_details" class="method_details_list">
|
|
480
|
+
<h2>Instance Method Details</h2>
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
<div class="method_details first">
|
|
484
|
+
<h3 class="signature first" id="loadFile-instance_method">
|
|
485
|
+
|
|
486
|
+
#<strong>loadFile</strong>(filePath, debugInfo) ⇒ <tt>Object</tt>
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
</h3><div class="docstring">
|
|
493
|
+
<div class="discussion">
|
|
494
|
+
|
|
495
|
+
<p>Loads a file.</p>
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
</div>
|
|
499
|
+
</div>
|
|
500
|
+
<div class="tags">
|
|
501
|
+
<p class="tag_title">Parameters:</p>
|
|
502
|
+
<ul class="param">
|
|
503
|
+
|
|
504
|
+
<li>
|
|
505
|
+
|
|
506
|
+
<span class='name'>filePath</span>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
<span class='type'></span>
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
—
|
|
514
|
+
<div class='inline'>
|
|
515
|
+
<p>The file path</p>
|
|
516
|
+
</div>
|
|
517
|
+
|
|
518
|
+
</li>
|
|
519
|
+
|
|
520
|
+
<li>
|
|
521
|
+
|
|
522
|
+
<span class='name'>debugInfo</span>
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
<span class='type'></span>
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
—
|
|
530
|
+
<div class='inline'>
|
|
531
|
+
<p>The debug information</p>
|
|
532
|
+
</div>
|
|
533
|
+
|
|
534
|
+
</li>
|
|
535
|
+
|
|
536
|
+
</ul>
|
|
537
|
+
|
|
538
|
+
<p class="tag_title">Returns:</p>
|
|
539
|
+
<ul class="return">
|
|
540
|
+
|
|
541
|
+
<li>
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
<span class='type'></span>
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
|
|
548
|
+
|
|
549
|
+
<div class='inline'>
|
|
550
|
+
<p>Itself</p>
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
</li>
|
|
554
|
+
|
|
555
|
+
</ul>
|
|
556
|
+
|
|
557
|
+
</div><table class="source_code">
|
|
558
|
+
<tr>
|
|
559
|
+
<td>
|
|
560
|
+
<pre class="lines">
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
52
|
|
564
|
+
53
|
|
565
|
+
54
|
|
566
|
+
55
|
|
567
|
+
56
|
|
568
|
+
57
|
|
569
|
+
58
|
|
570
|
+
59
|
|
571
|
+
60
|
|
572
|
+
61
|
|
573
|
+
62
|
|
574
|
+
63
|
|
575
|
+
64
|
|
576
|
+
65</pre>
|
|
577
|
+
</td>
|
|
578
|
+
<td>
|
|
579
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 52</span>
|
|
580
|
+
|
|
581
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_loadFile'>loadFile</span><span class='lparen'>(</span><span class='id identifier rubyid_filePath'>filePath</span><span class='comma'>,</span> <span class='id identifier rubyid_debugInfo'>debugInfo</span><span class='rparen'>)</span>
|
|
582
|
+
<span class='kw'>begin</span>
|
|
583
|
+
<span class='id identifier rubyid_require'>require</span> <span class='id identifier rubyid_filePath'>filePath</span>
|
|
584
|
+
<span class='kw'>rescue</span> <span class='const'>LoadError</span>
|
|
585
|
+
|
|
586
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#DEBUG-constant" title="Core::DEBUG (constant)">DEBUG</a></span></span>
|
|
587
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_debugInfo'>debugInfo</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>: </span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_filePath'>filePath</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'> not found in </span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#ROOT-constant" title="Core::ROOT (constant)">ROOT</a></span></span> <span class='op'>+</span> <span class='id identifier rubyid_debugInfo'>debugInfo</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span>
|
|
588
|
+
<span class='kw'>end</span>
|
|
589
|
+
|
|
590
|
+
<span class='id identifier rubyid_exit'>exit</span><span class='lparen'>(</span><span class='int'>1</span><span class='rparen'>)</span>
|
|
591
|
+
<span class='kw'>end</span>
|
|
592
|
+
|
|
593
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
|
594
|
+
<span class='kw'>end</span></pre>
|
|
595
|
+
</td>
|
|
596
|
+
</tr>
|
|
597
|
+
</table>
|
|
598
|
+
</div>
|
|
599
|
+
|
|
600
|
+
<div class="method_details ">
|
|
601
|
+
<h3 class="signature " id="loadModel-instance_method">
|
|
602
|
+
|
|
603
|
+
#<strong>loadModel</strong>(name) ⇒ <tt>Object</tt>
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
|
|
609
|
+
</h3><div class="docstring">
|
|
610
|
+
<div class="discussion">
|
|
611
|
+
|
|
612
|
+
<p>Loads a model.</p>
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
</div>
|
|
616
|
+
</div>
|
|
617
|
+
<div class="tags">
|
|
618
|
+
<p class="tag_title">Parameters:</p>
|
|
619
|
+
<ul class="param">
|
|
620
|
+
|
|
621
|
+
<li>
|
|
622
|
+
|
|
623
|
+
<span class='name'>name</span>
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
<span class='type'></span>
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
—
|
|
631
|
+
<div class='inline'>
|
|
632
|
+
<p>The model to load</p>
|
|
633
|
+
</div>
|
|
634
|
+
|
|
635
|
+
</li>
|
|
636
|
+
|
|
637
|
+
</ul>
|
|
638
|
+
|
|
639
|
+
<p class="tag_title">Returns:</p>
|
|
640
|
+
<ul class="return">
|
|
641
|
+
|
|
642
|
+
<li>
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
<span class='type'></span>
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
<div class='inline'>
|
|
651
|
+
<p>Model instance</p>
|
|
652
|
+
</div>
|
|
653
|
+
|
|
654
|
+
</li>
|
|
655
|
+
|
|
656
|
+
</ul>
|
|
657
|
+
|
|
658
|
+
</div><table class="source_code">
|
|
659
|
+
<tr>
|
|
660
|
+
<td>
|
|
661
|
+
<pre class="lines">
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
150
|
|
665
|
+
151
|
|
666
|
+
152
|
|
667
|
+
153
|
|
668
|
+
154
|
|
669
|
+
155
|
|
670
|
+
156
|
|
671
|
+
157
|
|
672
|
+
158
|
|
673
|
+
159
|
|
674
|
+
160
|
|
675
|
+
161
|
|
676
|
+
162
|
|
677
|
+
163
|
|
678
|
+
164
|
|
679
|
+
165
|
|
680
|
+
166
|
|
681
|
+
167</pre>
|
|
682
|
+
</td>
|
|
683
|
+
<td>
|
|
684
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 150</span>
|
|
685
|
+
|
|
686
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_loadModel'>loadModel</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
687
|
+
|
|
688
|
+
<span class='id identifier rubyid_filePath'>filePath</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='id identifier rubyid_modelPath'><span class='object_link'><a href="Core.html#modelPath-class_method" title="Core.modelPath (method)">modelPath</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
689
|
+
|
|
690
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_loadFile'>loadFile</span><span class='lparen'>(</span><span class='id identifier rubyid_filePath'>filePath</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Model</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
691
|
+
|
|
692
|
+
<span class='comment'>## Will retrieve class constant name for dynamic instanciation
|
|
693
|
+
</span> <span class='id identifier rubyid_modelName'>modelName</span> <span class='op'>=</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
694
|
+
|
|
695
|
+
<span class='comment'>## Make an only one instance of model (Singleton pattern)
|
|
696
|
+
</span> <span class='comment'>## to ensure date integrity.
|
|
697
|
+
</span> <span class='id identifier rubyid_model'>model</span> <span class='op'>=</span> <span class='id identifier rubyid_modelName'>modelName</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
698
|
+
|
|
699
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance_variable_set'>instance_variable_set</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='op'>+</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_model'>model</span><span class='rparen'>)</span>
|
|
700
|
+
|
|
701
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_model'>model</span>
|
|
702
|
+
|
|
703
|
+
<span class='kw'>end</span></pre>
|
|
704
|
+
</td>
|
|
705
|
+
</tr>
|
|
706
|
+
</table>
|
|
707
|
+
</div>
|
|
708
|
+
|
|
709
|
+
<div class="method_details ">
|
|
710
|
+
<h3 class="signature " id="render-instance_method">
|
|
711
|
+
|
|
712
|
+
#<strong>render</strong>(name, **args) ⇒ <tt>Object</tt>
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
|
|
718
|
+
</h3><div class="docstring">
|
|
719
|
+
<div class="discussion">
|
|
720
|
+
|
|
721
|
+
<p>Render view called by controller</p>
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
</div>
|
|
725
|
+
</div>
|
|
726
|
+
<div class="tags">
|
|
727
|
+
<p class="tag_title">Parameters:</p>
|
|
728
|
+
<ul class="param">
|
|
729
|
+
|
|
730
|
+
<li>
|
|
731
|
+
|
|
732
|
+
<span class='name'>name</span>
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
<span class='type'></span>
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
|
|
739
|
+
—
|
|
740
|
+
<div class='inline'>
|
|
741
|
+
<p>The view to render</p>
|
|
742
|
+
</div>
|
|
743
|
+
|
|
744
|
+
</li>
|
|
745
|
+
|
|
746
|
+
</ul>
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
</div><table class="source_code">
|
|
750
|
+
<tr>
|
|
751
|
+
<td>
|
|
752
|
+
<pre class="lines">
|
|
753
|
+
|
|
754
|
+
|
|
755
|
+
72
|
|
756
|
+
73
|
|
757
|
+
74
|
|
758
|
+
75
|
|
759
|
+
76
|
|
760
|
+
77
|
|
761
|
+
78
|
|
762
|
+
79
|
|
763
|
+
80
|
|
764
|
+
81
|
|
765
|
+
82
|
|
766
|
+
83
|
|
767
|
+
84
|
|
768
|
+
85
|
|
769
|
+
86
|
|
770
|
+
87
|
|
771
|
+
88
|
|
772
|
+
89
|
|
773
|
+
90
|
|
774
|
+
91
|
|
775
|
+
92
|
|
776
|
+
93
|
|
777
|
+
94
|
|
778
|
+
95
|
|
779
|
+
96
|
|
780
|
+
97
|
|
781
|
+
98
|
|
782
|
+
99
|
|
783
|
+
100
|
|
784
|
+
101
|
|
785
|
+
102
|
|
786
|
+
103
|
|
787
|
+
104
|
|
788
|
+
105
|
|
789
|
+
106
|
|
790
|
+
107
|
|
791
|
+
108
|
|
792
|
+
109
|
|
793
|
+
110
|
|
794
|
+
111
|
|
795
|
+
112
|
|
796
|
+
113
|
|
797
|
+
114
|
|
798
|
+
115
|
|
799
|
+
116
|
|
800
|
+
117
|
|
801
|
+
118
|
|
802
|
+
119
|
|
803
|
+
120
|
|
804
|
+
121
|
|
805
|
+
122
|
|
806
|
+
123
|
|
807
|
+
124
|
|
808
|
+
125
|
|
809
|
+
126</pre>
|
|
810
|
+
</td>
|
|
811
|
+
<td>
|
|
812
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 72</span>
|
|
813
|
+
|
|
814
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
|
|
815
|
+
|
|
816
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#DEBUG-constant" title="Core::DEBUG (constant)">DEBUG</a></span></span>
|
|
817
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Loading view...</span><span class='tstring_end'>"</span></span>
|
|
818
|
+
<span class='kw'>end</span>
|
|
819
|
+
|
|
820
|
+
<span class='id identifier rubyid_name'>name</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#VIEW-constant" title="Core::VIEW (constant)">VIEW</a></span></span> <span class='op'>+</span> <span class='id identifier rubyid_name'>name</span>
|
|
821
|
+
|
|
822
|
+
<span class='id identifier rubyid_filePath'>filePath</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='id identifier rubyid_viewPath'><span class='object_link'><a href="Core.html#viewPath-class_method" title="Core.viewPath (method)">viewPath</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
823
|
+
|
|
824
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_loadFile'>loadFile</span><span class='lparen'>(</span><span class='id identifier rubyid_filePath'>filePath</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>View</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
825
|
+
|
|
826
|
+
<span class='comment'>## Will retrieve class constant name for dynamic instanciation
|
|
827
|
+
</span> <span class='id identifier rubyid_viewName'>viewName</span> <span class='op'>=</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span>
|
|
828
|
+
|
|
829
|
+
<span class='id identifier rubyid_view'>view</span> <span class='op'>=</span> <span class='id identifier rubyid_viewName'>viewName</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
830
|
+
|
|
831
|
+
<span class='comment'>## Force children controller and view
|
|
832
|
+
</span> <span class='comment'>## to run parent initialize if overriden.
|
|
833
|
+
</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='id identifier rubyid_forceParentInit'><span class='object_link'><a href="Core.html#forceParentInit-class_method" title="Core.forceParentInit (method)">forceParentInit</a></span></span><span class='lparen'>(</span><span class='kw'>self</span><span class='rparen'>)</span>
|
|
834
|
+
<span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='id identifier rubyid_forceParentInit'><span class='object_link'><a href="Core.html#forceParentInit-class_method" title="Core.forceParentInit (method)">forceParentInit</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
|
|
835
|
+
|
|
836
|
+
<span class='comment'>## Set values sent from previous view in
|
|
837
|
+
</span> <span class='comment'>## content of current view.
|
|
838
|
+
</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lbrace'>{</span>
|
|
839
|
+
<span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
|
840
|
+
<span class='ivar'>@content</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
|
841
|
+
<span class='rbrace'>}</span>
|
|
842
|
+
|
|
843
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_set_properties'>set_properties</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
|
|
844
|
+
|
|
845
|
+
<span class='comment'>## Collect content from controller and send it to view
|
|
846
|
+
</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_controller'>controller</span> <span class='op'>=</span> <span class='kw'>self</span>
|
|
847
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
848
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='ivar'>@content</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
849
|
+
|
|
850
|
+
<span class='comment'>## Refer controller methods in view for easier
|
|
851
|
+
</span> <span class='comment'>## call.
|
|
852
|
+
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_instance_methods'>instance_methods</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_method'>method</span><span class='op'>|</span>
|
|
853
|
+
<span class='kw'>if</span> <span class='op'>!</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_method_defined?'>method_defined?</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span>
|
|
854
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_define_singleton_method'>define_singleton_method</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='op'>|</span>
|
|
855
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_controller'>controller</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_arguments'>arguments</span><span class='rparen'>)</span>
|
|
856
|
+
<span class='kw'>end</span>
|
|
857
|
+
<span class='kw'>end</span>
|
|
858
|
+
<span class='kw'>end</span>
|
|
859
|
+
|
|
860
|
+
<span class='comment'>## Will render view with content retrieved in controller
|
|
861
|
+
</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_setInstanceVars'>setInstanceVars</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
862
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
863
|
+
|
|
864
|
+
<span class='const'><span class='object_link'><a href="Fenetre.html" title="Fenetre (module)">Fenetre</a></span></span><span class='op'>::</span><span class='id identifier rubyid_css'><span class='object_link'><a href="Fenetre.html#css-class_method" title="Fenetre.css (method)">css</a></span></span><span class='lparen'>(</span><span class='symbol'>:priorite</span> <span class='op'>=></span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PRIORITY_APPLICATION</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
865
|
+
|
|
866
|
+
<span class='comment'>## Display content builded in view with Gtk
|
|
867
|
+
</span> <span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_show_all'>show_all</span>
|
|
868
|
+
<span class='kw'>end</span></pre>
|
|
869
|
+
</td>
|
|
870
|
+
</tr>
|
|
871
|
+
</table>
|
|
872
|
+
</div>
|
|
873
|
+
|
|
874
|
+
<div class="method_details ">
|
|
875
|
+
<h3 class="signature " id="run-instance_method">
|
|
876
|
+
|
|
877
|
+
#<strong>run</strong> ⇒ <tt>Object</tt>
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
</h3><div class="docstring">
|
|
884
|
+
<div class="discussion">
|
|
885
|
+
|
|
886
|
+
<p>Invoke all method in controller for collecting contents to send on view.</p>
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
</div>
|
|
890
|
+
</div>
|
|
891
|
+
<div class="tags">
|
|
892
|
+
|
|
893
|
+
<p class="tag_title">Returns:</p>
|
|
894
|
+
<ul class="return">
|
|
895
|
+
|
|
896
|
+
<li>
|
|
897
|
+
|
|
898
|
+
|
|
899
|
+
<span class='type'></span>
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
|
|
903
|
+
|
|
904
|
+
<div class='inline'>
|
|
905
|
+
<p>itself</p>
|
|
906
|
+
</div>
|
|
907
|
+
|
|
908
|
+
</li>
|
|
909
|
+
|
|
910
|
+
</ul>
|
|
911
|
+
|
|
912
|
+
</div><table class="source_code">
|
|
913
|
+
<tr>
|
|
914
|
+
<td>
|
|
915
|
+
<pre class="lines">
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
173
|
|
919
|
+
174
|
|
920
|
+
175
|
|
921
|
+
176
|
|
922
|
+
177
|
|
923
|
+
178</pre>
|
|
924
|
+
</td>
|
|
925
|
+
<td>
|
|
926
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 173</span>
|
|
927
|
+
|
|
928
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
929
|
+
<span class='kw'>if</span> <span class='const'><span class='object_link'><a href="Core.html" title="Core (module)">Core</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Core.html#DEBUG-constant" title="Core::DEBUG (constant)">DEBUG</a></span></span>
|
|
930
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Controller </span><span class='embexpr_beg'>#{</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='embexpr_end'>}</span><span class='tstring_content'> can't collect content because run method is not redefined.</span><span class='tstring_end'>"</span></span>
|
|
931
|
+
<span class='kw'>end</span>
|
|
932
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
|
933
|
+
<span class='kw'>end</span></pre>
|
|
934
|
+
</td>
|
|
935
|
+
</tr>
|
|
936
|
+
</table>
|
|
937
|
+
</div>
|
|
938
|
+
|
|
939
|
+
<div class="method_details ">
|
|
940
|
+
<h3 class="signature " id="set_properties-instance_method">
|
|
941
|
+
|
|
942
|
+
#<strong>set_properties</strong>(view) ⇒ <tt>Object</tt>
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
948
|
+
</h3><div class="docstring">
|
|
949
|
+
<div class="discussion">
|
|
950
|
+
|
|
951
|
+
<p>Sets the properties of window</p>
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
</div>
|
|
955
|
+
</div>
|
|
956
|
+
<div class="tags">
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
</div><table class="source_code">
|
|
960
|
+
<tr>
|
|
961
|
+
<td>
|
|
962
|
+
<pre class="lines">
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
131
|
|
966
|
+
132
|
|
967
|
+
133
|
|
968
|
+
134
|
|
969
|
+
135
|
|
970
|
+
136
|
|
971
|
+
137
|
|
972
|
+
138
|
|
973
|
+
139
|
|
974
|
+
140
|
|
975
|
+
141</pre>
|
|
976
|
+
</td>
|
|
977
|
+
<td>
|
|
978
|
+
<pre class="code"><span class="info file"># File 'app/core/Controller.rb', line 131</span>
|
|
979
|
+
|
|
980
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_properties'>set_properties</span><span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='rparen'>)</span>
|
|
981
|
+
<span class='comment'>## Set window properties
|
|
982
|
+
</span>
|
|
983
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_headerBar'>headerBar</span><span class='period'>.</span><span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='ivar'>@title</span>
|
|
984
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_set_titlebar'>set_titlebar</span> <span class='lparen'>(</span><span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_headerBar'>headerBar</span><span class='rparen'>)</span>
|
|
985
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_set_size_request'>set_size_request</span><span class='lparen'>(</span><span class='ivar'>@width</span><span class='comma'>,</span> <span class='ivar'>@height</span><span class='rparen'>)</span>
|
|
986
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_border_width'>border_width</span> <span class='op'>=</span> <span class='ivar'>@borderWidth</span>
|
|
987
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_set_resizable'>set_resizable</span><span class='lparen'>(</span><span class='ivar'>@resizable</span><span class='rparen'>)</span>
|
|
988
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_window'>window</span><span class='period'>.</span><span class='id identifier rubyid_set_window_position'>set_window_position</span><span class='lparen'>(</span><span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_const_get'>const_get</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Gtk::WindowPosition::</span><span class='tstring_end'>"</span></span> <span class='op'>+</span> <span class='ivar'>@position</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
|
989
|
+
|
|
990
|
+
<span class='kw'>end</span></pre>
|
|
991
|
+
</td>
|
|
992
|
+
</tr>
|
|
993
|
+
</table>
|
|
994
|
+
</div>
|
|
995
|
+
|
|
996
|
+
</div>
|
|
997
|
+
|
|
998
|
+
</div>
|
|
999
|
+
|
|
1000
|
+
<div id="footer">
|
|
1001
|
+
Generated on Sat Apr 22 22:47:30 2017 by
|
|
1002
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1003
|
+
0.9.8 (ruby-2.3.3).
|
|
1004
|
+
</div>
|
|
1005
|
+
|
|
1006
|
+
</div>
|
|
1007
|
+
</body>
|
|
1008
|
+
</html>
|