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/Conf.html
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
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: Conf
|
|
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 = "Conf";
|
|
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">Conf</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: Conf
|
|
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">Conf</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<dl>
|
|
91
|
+
<dt>Includes:</dt>
|
|
92
|
+
<dd>Singleton</dd>
|
|
93
|
+
</dl>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dl>
|
|
101
|
+
<dt>Defined in:</dt>
|
|
102
|
+
<dd>app/core/Conf.rb</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
|
108
|
+
<div class="discussion">
|
|
109
|
+
|
|
110
|
+
<p>Classe permettant de gérer le core (configuration unique)</p>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="tags">
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
123
|
+
<ul class="summary">
|
|
124
|
+
|
|
125
|
+
<li class="public ">
|
|
126
|
+
<span class="summary_signature">
|
|
127
|
+
|
|
128
|
+
<a href="#app-instance_method" title="#app (instance method)">#<strong>app</strong> ⇒ Object </a>
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<span class="note title readonly">readonly</span>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
<span class="summary_desc"><div class='inline'>
|
|
148
|
+
<p>Returns the value of attribute app.</p>
|
|
149
|
+
</div></span>
|
|
150
|
+
|
|
151
|
+
</li>
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<li class="public ">
|
|
155
|
+
<span class="summary_signature">
|
|
156
|
+
|
|
157
|
+
<a href="#db-instance_method" title="#db (instance method)">#<strong>db</strong> ⇒ Object </a>
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</span>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<span class="note title readonly">readonly</span>
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
<span class="summary_desc"><div class='inline'>
|
|
177
|
+
<p>Returns the value of attribute db.</p>
|
|
178
|
+
</div></span>
|
|
179
|
+
|
|
180
|
+
</li>
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
</ul>
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
<h2>
|
|
190
|
+
Instance Method Summary
|
|
191
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
192
|
+
</h2>
|
|
193
|
+
|
|
194
|
+
<ul class="summary">
|
|
195
|
+
|
|
196
|
+
<li class="public ">
|
|
197
|
+
<span class="summary_signature">
|
|
198
|
+
|
|
199
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Conf </a>
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
</span>
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
<span class="note title constructor">constructor</span>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<span class="summary_desc"><div class='inline'>
|
|
216
|
+
<p>Initialisation.</p>
|
|
217
|
+
</div></span>
|
|
218
|
+
|
|
219
|
+
</li>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
</ul>
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
<div id="constructor_details" class="method_details_list">
|
|
227
|
+
<h2>Constructor Details</h2>
|
|
228
|
+
|
|
229
|
+
<div class="method_details first">
|
|
230
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
231
|
+
|
|
232
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Conf (class)">Conf</a></span></tt>
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
</h3><div class="docstring">
|
|
239
|
+
<div class="discussion">
|
|
240
|
+
|
|
241
|
+
<p>Initialisation</p>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
</div>
|
|
245
|
+
</div>
|
|
246
|
+
<div class="tags">
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
</div><table class="source_code">
|
|
250
|
+
<tr>
|
|
251
|
+
<td>
|
|
252
|
+
<pre class="lines">
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
20
|
|
256
|
+
21
|
|
257
|
+
22
|
|
258
|
+
23
|
|
259
|
+
24</pre>
|
|
260
|
+
</td>
|
|
261
|
+
<td>
|
|
262
|
+
<pre class="code"><span class="info file"># File 'app/core/Conf.rb', line 20</span>
|
|
263
|
+
|
|
264
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='lparen'>(</span><span class='rparen'>)</span>
|
|
265
|
+
<span class='comment'>## TODO: Add some exceptions handling
|
|
266
|
+
</span> <span class='ivar'>@app</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>config/app.yml</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
267
|
+
<span class='ivar'>@db</span> <span class='op'>=</span> <span class='const'>YAML</span><span class='period'>.</span><span class='id identifier rubyid_load_file'>load_file</span><span class='lparen'>(</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='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>config/database.yml</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
|
268
|
+
<span class='kw'>end</span></pre>
|
|
269
|
+
</td>
|
|
270
|
+
</tr>
|
|
271
|
+
</table>
|
|
272
|
+
</div>
|
|
273
|
+
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div id="instance_attr_details" class="attr_details">
|
|
277
|
+
<h2>Instance Attribute Details</h2>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<span id=""></span>
|
|
281
|
+
<div class="method_details first">
|
|
282
|
+
<h3 class="signature first" id="app-instance_method">
|
|
283
|
+
|
|
284
|
+
#<strong>app</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
</h3><div class="docstring">
|
|
291
|
+
<div class="discussion">
|
|
292
|
+
|
|
293
|
+
<p>Returns the value of attribute app</p>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
<div class="tags">
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
</div><table class="source_code">
|
|
302
|
+
<tr>
|
|
303
|
+
<td>
|
|
304
|
+
<pre class="lines">
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
15
|
|
308
|
+
16
|
|
309
|
+
17</pre>
|
|
310
|
+
</td>
|
|
311
|
+
<td>
|
|
312
|
+
<pre class="code"><span class="info file"># File 'app/core/Conf.rb', line 15</span>
|
|
313
|
+
|
|
314
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_app'>app</span>
|
|
315
|
+
<span class='ivar'>@app</span>
|
|
316
|
+
<span class='kw'>end</span></pre>
|
|
317
|
+
</td>
|
|
318
|
+
</tr>
|
|
319
|
+
</table>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
<span id=""></span>
|
|
324
|
+
<div class="method_details ">
|
|
325
|
+
<h3 class="signature " id="db-instance_method">
|
|
326
|
+
|
|
327
|
+
#<strong>db</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
</h3><div class="docstring">
|
|
334
|
+
<div class="discussion">
|
|
335
|
+
|
|
336
|
+
<p>Returns the value of attribute db</p>
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="tags">
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
</div><table class="source_code">
|
|
345
|
+
<tr>
|
|
346
|
+
<td>
|
|
347
|
+
<pre class="lines">
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
15
|
|
351
|
+
16
|
|
352
|
+
17</pre>
|
|
353
|
+
</td>
|
|
354
|
+
<td>
|
|
355
|
+
<pre class="code"><span class="info file"># File 'app/core/Conf.rb', line 15</span>
|
|
356
|
+
|
|
357
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_db'>db</span>
|
|
358
|
+
<span class='ivar'>@db</span>
|
|
359
|
+
<span class='kw'>end</span></pre>
|
|
360
|
+
</td>
|
|
361
|
+
</tr>
|
|
362
|
+
</table>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<div id="footer">
|
|
371
|
+
Generated on Sat Apr 22 22:47:30 2017 by
|
|
372
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
373
|
+
0.9.8 (ruby-2.3.3).
|
|
374
|
+
</div>
|
|
375
|
+
|
|
376
|
+
</div>
|
|
377
|
+
</body>
|
|
378
|
+
</html>
|
|
@@ -0,0 +1,1115 @@
|
|
|
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: Configuration
|
|
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 = "Configuration";
|
|
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">Configuration</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: Configuration
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName"><span class='object_link'><a href="Model.html" title="Model (class)">Model</a></span></span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next"><span class='object_link'><a href="Model.html" title="Model (class)">Model</a></span></li>
|
|
78
|
+
|
|
79
|
+
<li class="next">Configuration</li>
|
|
80
|
+
|
|
81
|
+
</ul>
|
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
83
|
+
|
|
84
|
+
</dd>
|
|
85
|
+
</dl>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
<dl>
|
|
98
|
+
<dt>Defined in:</dt>
|
|
99
|
+
<dd>app/model/Configuration.rb</dd>
|
|
100
|
+
</dl>
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
|
105
|
+
<div class="discussion">
|
|
106
|
+
|
|
107
|
+
<p>Déclaration de la table contenant les paramètres Modèle de configuration</p>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
<div class="tags">
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
</div>
|
|
116
|
+
<h2>Constant Summary</h2>
|
|
117
|
+
<dl class="constants">
|
|
118
|
+
|
|
119
|
+
<dt id="CL_CASE_BASE-constant" class="">CL_CASE_BASE =
|
|
120
|
+
<div class="docstring">
|
|
121
|
+
<div class="discussion">
|
|
122
|
+
|
|
123
|
+
<p>Définit la couleur de la case de base</p>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="tags">
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
</div>
|
|
132
|
+
</dt>
|
|
133
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>65535, 65535, 65535</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
134
|
+
|
|
135
|
+
<dt id="CL_CASE_FIXE-constant" class="">CL_CASE_FIXE =
|
|
136
|
+
<div class="docstring">
|
|
137
|
+
<div class="discussion">
|
|
138
|
+
|
|
139
|
+
<p>Définit la couleur de la case fixe</p>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="tags">
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
</div>
|
|
148
|
+
</dt>
|
|
149
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>55000, 55000, 55000</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
150
|
+
|
|
151
|
+
<dt id="CL_CASE_SELECTIONNE-constant" class="">CL_CASE_SELECTIONNE =
|
|
152
|
+
<div class="docstring">
|
|
153
|
+
<div class="discussion">
|
|
154
|
+
|
|
155
|
+
<p>Définit la couleur de la case sélectionnée</p>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<div class="tags">
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
</div>
|
|
164
|
+
</dt>
|
|
165
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>64764, 59881, 20303</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
166
|
+
|
|
167
|
+
<dt id="CL_INDICES-constant" class="">CL_INDICES =
|
|
168
|
+
<div class="docstring">
|
|
169
|
+
<div class="discussion">
|
|
170
|
+
|
|
171
|
+
<p>Définit la couleur des indices</p>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="tags">
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
</div>
|
|
180
|
+
</dt>
|
|
181
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0, 32000, 65535</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
182
|
+
|
|
183
|
+
<dt id="CL_TEXTE-constant" class="">CL_TEXTE =
|
|
184
|
+
<div class="docstring">
|
|
185
|
+
<div class="discussion">
|
|
186
|
+
|
|
187
|
+
<p>Définit la couleur du texte</p>
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<div class="tags">
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</div>
|
|
196
|
+
</dt>
|
|
197
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0, 0, 0</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
198
|
+
|
|
199
|
+
<dt id="POLICE-constant" class="">POLICE =
|
|
200
|
+
<div class="docstring">
|
|
201
|
+
<div class="discussion">
|
|
202
|
+
|
|
203
|
+
<p>Définit la police du texte</p>
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
</div>
|
|
207
|
+
</div>
|
|
208
|
+
<div class="tags">
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
</div>
|
|
212
|
+
</dt>
|
|
213
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Sans Regular</span><span class='tstring_end'>"</span></span></pre></dd>
|
|
214
|
+
|
|
215
|
+
<dt id="TAILLE_POLICE-constant" class="">TAILLE_POLICE =
|
|
216
|
+
<div class="docstring">
|
|
217
|
+
<div class="discussion">
|
|
218
|
+
|
|
219
|
+
<p>Définit la taille de la police</p>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="tags">
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
</div>
|
|
228
|
+
</dt>
|
|
229
|
+
<dd><pre class="code"><span class='int'>25</span></pre></dd>
|
|
230
|
+
|
|
231
|
+
</dl>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
<h2>Instance Attribute Summary</h2>
|
|
239
|
+
|
|
240
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Model.html" title="Model (class)">Model</a></span></h3>
|
|
241
|
+
<p class="inherited"><span class='object_link'><a href="Model.html#db-instance_method" title="Model#db (method)">#db</a></span></p>
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
<h2>
|
|
246
|
+
Instance Method Summary
|
|
247
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
248
|
+
</h2>
|
|
249
|
+
|
|
250
|
+
<ul class="summary">
|
|
251
|
+
|
|
252
|
+
<li class="public ">
|
|
253
|
+
<span class="summary_signature">
|
|
254
|
+
|
|
255
|
+
<a href="#couleur-instance_method" title="#couleur (instance method)">#<strong>couleur</strong>(gdkColor) ⇒ Object </a>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</span>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
<span class="summary_desc"><div class='inline'>
|
|
270
|
+
<p>Convertis un gdk color en composantes sous forme d'une
|
|
271
|
+
chaîne séparée par une virgule.</p>
|
|
272
|
+
</div></span>
|
|
273
|
+
|
|
274
|
+
</li>
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
<li class="public ">
|
|
278
|
+
<span class="summary_signature">
|
|
279
|
+
|
|
280
|
+
<a href="#creerConfiguration-instance_method" title="#creerConfiguration (instance method)">#<strong>creerConfiguration</strong>(pseudo) ⇒ Object </a>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
</span>
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
<span class="summary_desc"><div class='inline'>
|
|
295
|
+
<p>Crée une configuration par défaut pour l'utilisateur.</p>
|
|
296
|
+
</div></span>
|
|
297
|
+
|
|
298
|
+
</li>
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
<li class="public ">
|
|
302
|
+
<span class="summary_signature">
|
|
303
|
+
|
|
304
|
+
<a href="#creerCouleur-instance_method" title="#creerCouleur (instance method)">#<strong>creerCouleur</strong>(composantes) ⇒ Object </a>
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
</span>
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<span class="summary_desc"><div class='inline'>
|
|
319
|
+
<p>Crée un gdk color à partir d'une chaîne.</p>
|
|
320
|
+
</div></span>
|
|
321
|
+
|
|
322
|
+
</li>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
<li class="public ">
|
|
326
|
+
<span class="summary_signature">
|
|
327
|
+
|
|
328
|
+
<a href="#enregistrer-instance_method" title="#enregistrer (instance method)">#<strong>enregistrer</strong>(pseudo, config) ⇒ Object </a>
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
</span>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
<span class="summary_desc"><div class='inline'>
|
|
343
|
+
<p>Enregistre la configuration dans la base de donnée.</p>
|
|
344
|
+
</div></span>
|
|
345
|
+
|
|
346
|
+
</li>
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
<li class="public ">
|
|
350
|
+
<span class="summary_signature">
|
|
351
|
+
|
|
352
|
+
<a href="#getConfiguration-instance_method" title="#getConfiguration (instance method)">#<strong>getConfiguration</strong>(pseudo) ⇒ Object </a>
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
</span>
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
<span class="summary_desc"><div class='inline'>
|
|
367
|
+
<p>Récupère la configuration de l'utilisateur.</p>
|
|
368
|
+
</div></span>
|
|
369
|
+
|
|
370
|
+
</li>
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
<li class="public ">
|
|
374
|
+
<span class="summary_signature">
|
|
375
|
+
|
|
376
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ Configuration </a>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
</span>
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
<span class="note title constructor">constructor</span>
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
<span class="summary_desc"><div class='inline'>
|
|
393
|
+
<p>Initialisation.</p>
|
|
394
|
+
</div></span>
|
|
395
|
+
|
|
396
|
+
</li>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
<li class="public ">
|
|
400
|
+
<span class="summary_signature">
|
|
401
|
+
|
|
402
|
+
<a href="#verifierCouleur-instance_method" title="#verifierCouleur (instance method)">#<strong>verifierCouleur</strong>(couleur) ⇒ Object </a>
|
|
403
|
+
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
</span>
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
<span class="summary_desc"><div class='inline'>
|
|
417
|
+
<p>Limite le dépassement de valeur d'une couleur 16 bits.</p>
|
|
418
|
+
</div></span>
|
|
419
|
+
|
|
420
|
+
</li>
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
</ul>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Model.html" title="Model (class)">Model</a></span></h3>
|
|
436
|
+
<p class="inherited"><span class='object_link'><a href="Model.html#connection-instance_method" title="Model#connection (method)">#connection</a></span>, <span class='object_link'><a href="Model.html#inherited-class_method" title="Model.inherited (method)">inherited</a></span>, <span class='object_link'><a href="Model.html#insert-instance_method" title="Model#insert (method)">#insert</a></span>, <span class='object_link'><a href="Model.html#mkDatabaseDir-instance_method" title="Model#mkDatabaseDir (method)">#mkDatabaseDir</a></span>, <span class='object_link'><a href="Model.html#to_h-instance_method" title="Model#to_h (method)">#to_h</a></span></p>
|
|
437
|
+
|
|
438
|
+
<div id="constructor_details" class="method_details_list">
|
|
439
|
+
<h2>Constructor Details</h2>
|
|
440
|
+
|
|
441
|
+
<div class="method_details first">
|
|
442
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
443
|
+
|
|
444
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></tt>
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
</h3><div class="docstring">
|
|
451
|
+
<div class="discussion">
|
|
452
|
+
|
|
453
|
+
<p>Initialisation</p>
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
</div>
|
|
457
|
+
</div>
|
|
458
|
+
<div class="tags">
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
</div><table class="source_code">
|
|
462
|
+
<tr>
|
|
463
|
+
<td>
|
|
464
|
+
<pre class="lines">
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
32
|
|
468
|
+
33
|
|
469
|
+
34
|
|
470
|
+
35
|
|
471
|
+
36
|
|
472
|
+
37
|
|
473
|
+
38
|
|
474
|
+
39
|
|
475
|
+
40
|
|
476
|
+
41
|
|
477
|
+
42
|
|
478
|
+
43
|
|
479
|
+
44
|
|
480
|
+
45
|
|
481
|
+
46
|
|
482
|
+
47</pre>
|
|
483
|
+
</td>
|
|
484
|
+
<td>
|
|
485
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 32</span>
|
|
486
|
+
|
|
487
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='rparen'>)</span>
|
|
488
|
+
|
|
489
|
+
<span class='comment'>## Crée la table configuration
|
|
490
|
+
</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>CREATE TABLE IF NOT EXISTS configuration (
|
|
491
|
+
config_id integer primary key autoincrement,
|
|
492
|
+
caseBase varchar(30) DEFAULT '</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#CL_CASE_BASE-constant" title="Configuration::CL_CASE_BASE (constant)">CL_CASE_BASE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>',
|
|
493
|
+
caseFixe varchar(30) DEFAULT '</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#CL_CASE_FIXE-constant" title="Configuration::CL_CASE_FIXE (constant)">CL_CASE_FIXE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>',
|
|
494
|
+
caseSelectionne varchar(30) DEFAULT '</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#CL_CASE_SELECTIONNE-constant" title="Configuration::CL_CASE_SELECTIONNE (constant)">CL_CASE_SELECTIONNE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>',
|
|
495
|
+
couleurTexte varchar(30) DEFAULT '</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#CL_TEXTE-constant" title="Configuration::CL_TEXTE (constant)">CL_TEXTE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>',
|
|
496
|
+
couleurIndices varchar(30) DEFAULT '</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#CL_INDICES-constant" title="Configuration::CL_INDICES (constant)">CL_INDICES</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>',
|
|
497
|
+
police varchar(50) DEFAULT 'Sans Regular',
|
|
498
|
+
taillePolice integer DEFAULT </span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="#TAILLE_POLICE-constant" title="Configuration::TAILLE_POLICE (constant)">TAILLE_POLICE</a></span></span><span class='embexpr_end'>}</span><span class='tstring_content'>,
|
|
499
|
+
utilisateur integer,
|
|
500
|
+
FOREIGN KEY(utilisateur) REFERENCES utilisateur(utilisateur_id)
|
|
501
|
+
);</span><span class='tstring_end'>"</span></span>
|
|
502
|
+
<span class='kw'>end</span></pre>
|
|
503
|
+
</td>
|
|
504
|
+
</tr>
|
|
505
|
+
</table>
|
|
506
|
+
</div>
|
|
507
|
+
|
|
508
|
+
</div>
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
<div id="instance_method_details" class="method_details_list">
|
|
512
|
+
<h2>Instance Method Details</h2>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<div class="method_details first">
|
|
516
|
+
<h3 class="signature first" id="couleur-instance_method">
|
|
517
|
+
|
|
518
|
+
#<strong>couleur</strong>(gdkColor) ⇒ <tt>Object</tt>
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
</h3><div class="docstring">
|
|
525
|
+
<div class="discussion">
|
|
526
|
+
|
|
527
|
+
<p>Convertis un gdk color en composantes</p>
|
|
528
|
+
|
|
529
|
+
<pre class="code ruby"><code class="ruby">sous forme d'une chaîne séparée par une virgule</code></pre>
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
</div>
|
|
533
|
+
</div>
|
|
534
|
+
<div class="tags">
|
|
535
|
+
<p class="tag_title">Parameters:</p>
|
|
536
|
+
<ul class="param">
|
|
537
|
+
|
|
538
|
+
<li>
|
|
539
|
+
|
|
540
|
+
<span class='name'>gdkColor</span>
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
<span class='type'></span>
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
—
|
|
548
|
+
<div class='inline'>
|
|
549
|
+
<p>GDK::Color</p>
|
|
550
|
+
</div>
|
|
551
|
+
|
|
552
|
+
</li>
|
|
553
|
+
|
|
554
|
+
</ul>
|
|
555
|
+
|
|
556
|
+
<p class="tag_title">Returns:</p>
|
|
557
|
+
<ul class="return">
|
|
558
|
+
|
|
559
|
+
<li>
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
<span class='type'></span>
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
<div class='inline'>
|
|
568
|
+
<p>Les composantes sous forme de chaîne</p>
|
|
569
|
+
</div>
|
|
570
|
+
|
|
571
|
+
</li>
|
|
572
|
+
|
|
573
|
+
</ul>
|
|
574
|
+
|
|
575
|
+
</div><table class="source_code">
|
|
576
|
+
<tr>
|
|
577
|
+
<td>
|
|
578
|
+
<pre class="lines">
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
127
|
|
582
|
+
128
|
|
583
|
+
129
|
|
584
|
+
130
|
|
585
|
+
131
|
|
586
|
+
132
|
|
587
|
+
133</pre>
|
|
588
|
+
</td>
|
|
589
|
+
<td>
|
|
590
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 127</span>
|
|
591
|
+
|
|
592
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_couleur'>couleur</span><span class='lparen'>(</span><span class='id identifier rubyid_gdkColor'>gdkColor</span><span class='rparen'>)</span>
|
|
593
|
+
<span class='id identifier rubyid_red'>red</span> <span class='op'>=</span> <span class='id identifier rubyid_gdkColor'>gdkColor</span><span class='period'>.</span><span class='id identifier rubyid_red'>red</span>
|
|
594
|
+
<span class='id identifier rubyid_green'>green</span> <span class='op'>=</span> <span class='id identifier rubyid_gdkColor'>gdkColor</span><span class='period'>.</span><span class='id identifier rubyid_green'>green</span>
|
|
595
|
+
<span class='id identifier rubyid_blue'>blue</span> <span class='op'>=</span> <span class='id identifier rubyid_gdkColor'>gdkColor</span><span class='period'>.</span><span class='id identifier rubyid_blue'>blue</span>
|
|
596
|
+
|
|
597
|
+
<span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_red'>red</span><span class='embexpr_end'>}</span><span class='tstring_content'>,</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_green'>green</span><span class='embexpr_end'>}</span><span class='tstring_content'>,</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_blue'>blue</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
598
|
+
<span class='kw'>end</span></pre>
|
|
599
|
+
</td>
|
|
600
|
+
</tr>
|
|
601
|
+
</table>
|
|
602
|
+
</div>
|
|
603
|
+
|
|
604
|
+
<div class="method_details ">
|
|
605
|
+
<h3 class="signature " id="creerConfiguration-instance_method">
|
|
606
|
+
|
|
607
|
+
#<strong>creerConfiguration</strong>(pseudo) ⇒ <tt>Object</tt>
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
</h3><div class="docstring">
|
|
614
|
+
<div class="discussion">
|
|
615
|
+
|
|
616
|
+
<p>Crée une configuration par défaut pour l'utilisateur</p>
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
<div class="tags">
|
|
622
|
+
<p class="tag_title">Parameters:</p>
|
|
623
|
+
<ul class="param">
|
|
624
|
+
|
|
625
|
+
<li>
|
|
626
|
+
|
|
627
|
+
<span class='name'>pseudo</span>
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
<span class='type'></span>
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
—
|
|
635
|
+
<div class='inline'>
|
|
636
|
+
<p>L'identifiant de l'utilisateur</p>
|
|
637
|
+
</div>
|
|
638
|
+
|
|
639
|
+
</li>
|
|
640
|
+
|
|
641
|
+
</ul>
|
|
642
|
+
|
|
643
|
+
<p class="tag_title">Returns:</p>
|
|
644
|
+
<ul class="return">
|
|
645
|
+
|
|
646
|
+
<li>
|
|
647
|
+
|
|
648
|
+
|
|
649
|
+
<span class='type'></span>
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
<div class='inline'>
|
|
655
|
+
<p>self</p>
|
|
656
|
+
</div>
|
|
657
|
+
|
|
658
|
+
</li>
|
|
659
|
+
|
|
660
|
+
</ul>
|
|
661
|
+
|
|
662
|
+
</div><table class="source_code">
|
|
663
|
+
<tr>
|
|
664
|
+
<td>
|
|
665
|
+
<pre class="lines">
|
|
666
|
+
|
|
667
|
+
|
|
668
|
+
159
|
|
669
|
+
160
|
|
670
|
+
161
|
|
671
|
+
162
|
|
672
|
+
163
|
|
673
|
+
164
|
|
674
|
+
165
|
|
675
|
+
166
|
|
676
|
+
167
|
|
677
|
+
168
|
|
678
|
+
169
|
|
679
|
+
170
|
|
680
|
+
171
|
|
681
|
+
172
|
|
682
|
+
173
|
|
683
|
+
174
|
|
684
|
+
175
|
|
685
|
+
176
|
|
686
|
+
177
|
|
687
|
+
178</pre>
|
|
688
|
+
</td>
|
|
689
|
+
<td>
|
|
690
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 159</span>
|
|
691
|
+
|
|
692
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_creerConfiguration'>creerConfiguration</span><span class='lparen'>(</span><span class='id identifier rubyid_pseudo'>pseudo</span><span class='rparen'>)</span>
|
|
693
|
+
|
|
694
|
+
<span class='comment'>## Récupère id utilisateur
|
|
695
|
+
</span> <span class='id identifier rubyid_req'>req</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT utilisateur_id FROM utilisateur WHERE pseudo = ?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_pseudo'>pseudo</span>
|
|
696
|
+
|
|
697
|
+
<span class='id identifier rubyid_params'>params</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='rparen'>)</span>
|
|
698
|
+
|
|
699
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:caseBase</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#CL_CASE_BASE-constant" title="Configuration::CL_CASE_BASE (constant)">CL_CASE_BASE</a></span></span>
|
|
700
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:caseFixe</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#CL_CASE_FIXE-constant" title="Configuration::CL_CASE_FIXE (constant)">CL_CASE_FIXE</a></span></span>
|
|
701
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:caseSelectionne</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#CL_CASE_SELECTIONNE-constant" title="Configuration::CL_CASE_SELECTIONNE (constant)">CL_CASE_SELECTIONNE</a></span></span>
|
|
702
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:couleurTexte</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#CL_TEXTE-constant" title="Configuration::CL_TEXTE (constant)">CL_TEXTE</a></span></span>
|
|
703
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:couleurIndices</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#CL_INDICES-constant" title="Configuration::CL_INDICES (constant)">CL_INDICES</a></span></span>
|
|
704
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:police</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#POLICE-constant" title="Configuration::POLICE (constant)">POLICE</a></span></span>
|
|
705
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:taillePolice</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="" title="Configuration (class)">Configuration</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="#TAILLE_POLICE-constant" title="Configuration::TAILLE_POLICE (constant)">TAILLE_POLICE</a></span></span>
|
|
706
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:utilisateur</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_req'>req</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
|
707
|
+
|
|
708
|
+
<span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
709
|
+
|
|
710
|
+
<span class='kw'>return</span> <span class='kw'>self</span>
|
|
711
|
+
<span class='kw'>end</span></pre>
|
|
712
|
+
</td>
|
|
713
|
+
</tr>
|
|
714
|
+
</table>
|
|
715
|
+
</div>
|
|
716
|
+
|
|
717
|
+
<div class="method_details ">
|
|
718
|
+
<h3 class="signature " id="creerCouleur-instance_method">
|
|
719
|
+
|
|
720
|
+
#<strong>creerCouleur</strong>(composantes) ⇒ <tt>Object</tt>
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
</h3><div class="docstring">
|
|
727
|
+
<div class="discussion">
|
|
728
|
+
|
|
729
|
+
<p>Crée un gdk color à partir d'une chaîne</p>
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
</div>
|
|
733
|
+
</div>
|
|
734
|
+
<div class="tags">
|
|
735
|
+
<p class="tag_title">Parameters:</p>
|
|
736
|
+
<ul class="param">
|
|
737
|
+
|
|
738
|
+
<li>
|
|
739
|
+
|
|
740
|
+
<span class='name'>composantes</span>
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
<span class='type'></span>
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
—
|
|
748
|
+
<div class='inline'>
|
|
749
|
+
<p>Composantes (“r,g,b”)</p>
|
|
750
|
+
</div>
|
|
751
|
+
|
|
752
|
+
</li>
|
|
753
|
+
|
|
754
|
+
</ul>
|
|
755
|
+
|
|
756
|
+
<p class="tag_title">Returns:</p>
|
|
757
|
+
<ul class="return">
|
|
758
|
+
|
|
759
|
+
<li>
|
|
760
|
+
|
|
761
|
+
|
|
762
|
+
<span class='type'></span>
|
|
763
|
+
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
<div class='inline'>
|
|
768
|
+
<p>Gdk::Color</p>
|
|
769
|
+
</div>
|
|
770
|
+
|
|
771
|
+
</li>
|
|
772
|
+
|
|
773
|
+
</ul>
|
|
774
|
+
|
|
775
|
+
</div><table class="source_code">
|
|
776
|
+
<tr>
|
|
777
|
+
<td>
|
|
778
|
+
<pre class="lines">
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
142
|
|
782
|
+
143
|
|
783
|
+
144
|
|
784
|
+
145
|
|
785
|
+
146
|
|
786
|
+
147
|
|
787
|
+
148
|
|
788
|
+
149
|
|
789
|
+
150</pre>
|
|
790
|
+
</td>
|
|
791
|
+
<td>
|
|
792
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 142</span>
|
|
793
|
+
|
|
794
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_creerCouleur'>creerCouleur</span><span class='lparen'>(</span><span class='id identifier rubyid_composantes'>composantes</span><span class='rparen'>)</span>
|
|
795
|
+
<span class='id identifier rubyid_rgb'>rgb</span> <span class='op'>=</span> <span class='id identifier rubyid_composantes'>composantes</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>
|
|
796
|
+
|
|
797
|
+
<span class='id identifier rubyid_red'>red</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_verifierCouleur'>verifierCouleur</span><span class='lparen'>(</span><span class='id identifier rubyid_rgb'>rgb</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
|
|
798
|
+
<span class='id identifier rubyid_green'>green</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_verifierCouleur'>verifierCouleur</span><span class='lparen'>(</span><span class='id identifier rubyid_rgb'>rgb</span><span class='lbracket'>[</span><span class='int'>1</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
|
|
799
|
+
<span class='id identifier rubyid_blue'>blue</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_verifierCouleur'>verifierCouleur</span><span class='lparen'>(</span><span class='id identifier rubyid_rgb'>rgb</span><span class='lbracket'>[</span><span class='int'>2</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span>
|
|
800
|
+
|
|
801
|
+
<span class='kw'>return</span> <span class='const'>Gdk</span><span class='op'>::</span><span class='const'>Color</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_red'>red</span><span class='comma'>,</span> <span class='id identifier rubyid_green'>green</span><span class='comma'>,</span> <span class='id identifier rubyid_blue'>blue</span><span class='rparen'>)</span>
|
|
802
|
+
<span class='kw'>end</span></pre>
|
|
803
|
+
</td>
|
|
804
|
+
</tr>
|
|
805
|
+
</table>
|
|
806
|
+
</div>
|
|
807
|
+
|
|
808
|
+
<div class="method_details ">
|
|
809
|
+
<h3 class="signature " id="enregistrer-instance_method">
|
|
810
|
+
|
|
811
|
+
#<strong>enregistrer</strong>(pseudo, config) ⇒ <tt>Object</tt>
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
</h3><div class="docstring">
|
|
818
|
+
<div class="discussion">
|
|
819
|
+
|
|
820
|
+
<p>Enregistre la configuration dans la base de donnée.</p>
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
</div>
|
|
824
|
+
</div>
|
|
825
|
+
<div class="tags">
|
|
826
|
+
<p class="tag_title">Parameters:</p>
|
|
827
|
+
<ul class="param">
|
|
828
|
+
|
|
829
|
+
<li>
|
|
830
|
+
|
|
831
|
+
<span class='name'>config</span>
|
|
832
|
+
|
|
833
|
+
|
|
834
|
+
<span class='type'></span>
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
—
|
|
839
|
+
<div class='inline'>
|
|
840
|
+
<p>La Configuration</p>
|
|
841
|
+
</div>
|
|
842
|
+
|
|
843
|
+
</li>
|
|
844
|
+
|
|
845
|
+
</ul>
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
</div><table class="source_code">
|
|
849
|
+
<tr>
|
|
850
|
+
<td>
|
|
851
|
+
<pre class="lines">
|
|
852
|
+
|
|
853
|
+
|
|
854
|
+
55
|
|
855
|
+
56
|
|
856
|
+
57
|
|
857
|
+
58
|
|
858
|
+
59
|
|
859
|
+
60
|
|
860
|
+
61
|
|
861
|
+
62
|
|
862
|
+
63
|
|
863
|
+
64
|
|
864
|
+
65
|
|
865
|
+
66
|
|
866
|
+
67
|
|
867
|
+
68
|
|
868
|
+
69
|
|
869
|
+
70
|
|
870
|
+
71
|
|
871
|
+
72
|
|
872
|
+
73
|
|
873
|
+
74
|
|
874
|
+
75</pre>
|
|
875
|
+
</td>
|
|
876
|
+
<td>
|
|
877
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 55</span>
|
|
878
|
+
|
|
879
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_enregistrer'>enregistrer</span><span class='lparen'>(</span><span class='id identifier rubyid_pseudo'>pseudo</span><span class='comma'>,</span> <span class='id identifier rubyid_config'>config</span><span class='rparen'>)</span>
|
|
880
|
+
<span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT utilisateur_id FROM utilisateur WHERE pseudo=?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_pseudo'>pseudo</span>
|
|
881
|
+
|
|
882
|
+
<span class='id identifier rubyid_req'>req</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT * FROM configuration WHERE utilisateur=?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span>
|
|
883
|
+
|
|
884
|
+
<span class='id identifier rubyid_params'>params</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='rparen'>)</span>
|
|
885
|
+
|
|
886
|
+
<span class='comment'>## Définit tout les paramètres à enregistrer à partir de la configuration
|
|
887
|
+
</span> <span class='id identifier rubyid_config'>config</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_param'>param</span><span class='op'>|</span>
|
|
888
|
+
<span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_param'>param</span>
|
|
889
|
+
<span class='kw'>end</span>
|
|
890
|
+
|
|
891
|
+
<span class='comment'>## Définit l'identifiant de l'utilisateur
|
|
892
|
+
</span> <span class='id identifier rubyid_params'>params</span><span class='lbracket'>[</span><span class='symbol'>:utilisateur</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
|
893
|
+
|
|
894
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_req'>req</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span> <span class='op'>></span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
895
|
+
<span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>DELETE FROM configuration WHERE utilisateur = ?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
|
896
|
+
<span class='kw'>end</span>
|
|
897
|
+
|
|
898
|
+
<span class='id identifier rubyid_insert'>insert</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
|
|
899
|
+
<span class='kw'>end</span></pre>
|
|
900
|
+
</td>
|
|
901
|
+
</tr>
|
|
902
|
+
</table>
|
|
903
|
+
</div>
|
|
904
|
+
|
|
905
|
+
<div class="method_details ">
|
|
906
|
+
<h3 class="signature " id="getConfiguration-instance_method">
|
|
907
|
+
|
|
908
|
+
#<strong>getConfiguration</strong>(pseudo) ⇒ <tt>Object</tt>
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
|
|
914
|
+
</h3><div class="docstring">
|
|
915
|
+
<div class="discussion">
|
|
916
|
+
|
|
917
|
+
<p>Récupère la configuration de l'utilisateur</p>
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
</div>
|
|
921
|
+
</div>
|
|
922
|
+
<div class="tags">
|
|
923
|
+
<p class="tag_title">Parameters:</p>
|
|
924
|
+
<ul class="param">
|
|
925
|
+
|
|
926
|
+
<li>
|
|
927
|
+
|
|
928
|
+
<span class='name'>pseudo</span>
|
|
929
|
+
|
|
930
|
+
|
|
931
|
+
<span class='type'></span>
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
|
|
935
|
+
—
|
|
936
|
+
<div class='inline'>
|
|
937
|
+
<p>Pseudo utilisateur</p>
|
|
938
|
+
</div>
|
|
939
|
+
|
|
940
|
+
</li>
|
|
941
|
+
|
|
942
|
+
</ul>
|
|
943
|
+
|
|
944
|
+
<p class="tag_title">Returns:</p>
|
|
945
|
+
<ul class="return">
|
|
946
|
+
|
|
947
|
+
<li>
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
<span class='type'></span>
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
|
|
954
|
+
|
|
955
|
+
<div class='inline'>
|
|
956
|
+
<p>Configuration sous forme de tableau</p>
|
|
957
|
+
</div>
|
|
958
|
+
|
|
959
|
+
</li>
|
|
960
|
+
|
|
961
|
+
</ul>
|
|
962
|
+
|
|
963
|
+
</div><table class="source_code">
|
|
964
|
+
<tr>
|
|
965
|
+
<td>
|
|
966
|
+
<pre class="lines">
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
84
|
|
970
|
+
85
|
|
971
|
+
86
|
|
972
|
+
87
|
|
973
|
+
88
|
|
974
|
+
89
|
|
975
|
+
90
|
|
976
|
+
91
|
|
977
|
+
92
|
|
978
|
+
93
|
|
979
|
+
94
|
|
980
|
+
95
|
|
981
|
+
96
|
|
982
|
+
97</pre>
|
|
983
|
+
</td>
|
|
984
|
+
<td>
|
|
985
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 84</span>
|
|
986
|
+
|
|
987
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_getConfiguration'>getConfiguration</span><span class='lparen'>(</span><span class='id identifier rubyid_pseudo'>pseudo</span><span class='rparen'>)</span>
|
|
988
|
+
<span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute'>execute</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT utilisateur_id FROM utilisateur WHERE pseudo=?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_pseudo'>pseudo</span>
|
|
989
|
+
|
|
990
|
+
<span class='id identifier rubyid_req'>req</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute2'>execute2</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT caseBase, caseFixe, caseSelectionne, couleurTexte, couleurIndices, taillePolice, police FROM configuration WHERE utilisateur=?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span>
|
|
991
|
+
|
|
992
|
+
<span class='comment'>## Pas de configuration trouvé donc on en
|
|
993
|
+
</span> <span class='comment'>## crée une
|
|
994
|
+
</span> <span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_req'>req</span> <span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>==</span> <span class='int'>1</span><span class='rparen'>)</span>
|
|
995
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_creerConfiguration'>creerConfiguration</span><span class='lparen'>(</span><span class='id identifier rubyid_pseudo'>pseudo</span><span class='rparen'>)</span>
|
|
996
|
+
<span class='id identifier rubyid_req'>req</span> <span class='op'>=</span> <span class='cvar'>@@db</span><span class='period'>.</span><span class='id identifier rubyid_execute2'>execute2</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SELECT caseBase, caseFixe, caseSelectionne, couleurTexte, couleurIndices, taillePolice, police FROM configuration WHERE utilisateur=?</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_utilisateur_id'>utilisateur_id</span>
|
|
997
|
+
<span class='kw'>end</span>
|
|
998
|
+
|
|
999
|
+
<span class='kw'>return</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_h'>to_h</span><span class='lparen'>(</span><span class='id identifier rubyid_req'>req</span><span class='rparen'>)</span><span class='lbracket'>[</span><span class='int'>0</span><span class='rbracket'>]</span>
|
|
1000
|
+
<span class='kw'>end</span></pre>
|
|
1001
|
+
</td>
|
|
1002
|
+
</tr>
|
|
1003
|
+
</table>
|
|
1004
|
+
</div>
|
|
1005
|
+
|
|
1006
|
+
<div class="method_details ">
|
|
1007
|
+
<h3 class="signature " id="verifierCouleur-instance_method">
|
|
1008
|
+
|
|
1009
|
+
#<strong>verifierCouleur</strong>(couleur) ⇒ <tt>Object</tt>
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
</h3><div class="docstring">
|
|
1016
|
+
<div class="discussion">
|
|
1017
|
+
|
|
1018
|
+
<p>Limite le dépassement de valeur d'une couleur 16 bits</p>
|
|
1019
|
+
|
|
1020
|
+
|
|
1021
|
+
</div>
|
|
1022
|
+
</div>
|
|
1023
|
+
<div class="tags">
|
|
1024
|
+
<p class="tag_title">Parameters:</p>
|
|
1025
|
+
<ul class="param">
|
|
1026
|
+
|
|
1027
|
+
<li>
|
|
1028
|
+
|
|
1029
|
+
<span class='name'>couleur</span>
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
<span class='type'></span>
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
—
|
|
1037
|
+
<div class='inline'>
|
|
1038
|
+
<p>La couleur à vérifier</p>
|
|
1039
|
+
</div>
|
|
1040
|
+
|
|
1041
|
+
</li>
|
|
1042
|
+
|
|
1043
|
+
</ul>
|
|
1044
|
+
|
|
1045
|
+
<p class="tag_title">Returns:</p>
|
|
1046
|
+
<ul class="return">
|
|
1047
|
+
|
|
1048
|
+
<li>
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
<span class='type'></span>
|
|
1052
|
+
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
|
|
1056
|
+
<div class='inline'>
|
|
1057
|
+
<p>La couleur limitée à la borne si dépassement sinon la couleur elle même</p>
|
|
1058
|
+
</div>
|
|
1059
|
+
|
|
1060
|
+
</li>
|
|
1061
|
+
|
|
1062
|
+
</ul>
|
|
1063
|
+
|
|
1064
|
+
</div><table class="source_code">
|
|
1065
|
+
<tr>
|
|
1066
|
+
<td>
|
|
1067
|
+
<pre class="lines">
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
106
|
|
1071
|
+
107
|
|
1072
|
+
108
|
|
1073
|
+
109
|
|
1074
|
+
110
|
|
1075
|
+
111
|
|
1076
|
+
112
|
|
1077
|
+
113
|
|
1078
|
+
114
|
|
1079
|
+
115
|
|
1080
|
+
116
|
|
1081
|
+
117</pre>
|
|
1082
|
+
</td>
|
|
1083
|
+
<td>
|
|
1084
|
+
<pre class="code"><span class="info file"># File 'app/model/Configuration.rb', line 106</span>
|
|
1085
|
+
|
|
1086
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_verifierCouleur'>verifierCouleur</span><span class='lparen'>(</span><span class='id identifier rubyid_couleur'>couleur</span><span class='rparen'>)</span>
|
|
1087
|
+
<span class='id identifier rubyid_max'>max</span> <span class='op'>=</span> <span class='int'>65535</span>
|
|
1088
|
+
<span class='id identifier rubyid_min'>min</span> <span class='op'>=</span> <span class='int'>0</span>
|
|
1089
|
+
|
|
1090
|
+
<span class='kw'>if</span><span class='lparen'>(</span><span class='id identifier rubyid_couleur'>couleur</span> <span class='op'>></span> <span class='id identifier rubyid_max'>max</span><span class='rparen'>)</span>
|
|
1091
|
+
<span class='id identifier rubyid_couleur'>couleur</span> <span class='op'>=</span> <span class='id identifier rubyid_max'>max</span>
|
|
1092
|
+
<span class='kw'>elsif</span><span class='lparen'>(</span><span class='id identifier rubyid_couleur'>couleur</span> <span class='op'><</span> <span class='int'>0</span><span class='rparen'>)</span>
|
|
1093
|
+
<span class='id identifier rubyid_couleur'>couleur</span> <span class='op'>=</span> <span class='id identifier rubyid_min'>min</span>
|
|
1094
|
+
<span class='kw'>end</span>
|
|
1095
|
+
|
|
1096
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_couleur'>couleur</span>
|
|
1097
|
+
<span class='kw'>end</span></pre>
|
|
1098
|
+
</td>
|
|
1099
|
+
</tr>
|
|
1100
|
+
</table>
|
|
1101
|
+
</div>
|
|
1102
|
+
|
|
1103
|
+
</div>
|
|
1104
|
+
|
|
1105
|
+
</div>
|
|
1106
|
+
|
|
1107
|
+
<div id="footer">
|
|
1108
|
+
Generated on Sat Apr 22 22:47:31 2017 by
|
|
1109
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1110
|
+
0.9.8 (ruby-2.3.3).
|
|
1111
|
+
</div>
|
|
1112
|
+
|
|
1113
|
+
</div>
|
|
1114
|
+
</body>
|
|
1115
|
+
</html>
|