fandom-word 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +5 -0
- data/.gitignore +3 -1
- data/.rspec +3 -0
- data/.rubocop.yml +16 -1
- data/.travis.yml +7 -0
- data/.yardoc/checksums +5 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +18 -2
- data/README.md +15 -11
- data/Rakefile +61 -7
- data/data/words.data +0 -0
- data/doc/FandomWord.html +347 -0
- data/doc/FandomWord/FandomRandomizer.html +419 -0
- data/doc/FandomWord/FandomWordCatalog.html +424 -0
- data/doc/FandomWord/Fandoms.html +617 -0
- data/doc/_index.html +128 -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 +121 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +121 -0
- data/doc/js/app.js +248 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +123 -0
- data/doc/top-level-namespace.html +110 -0
- data/fandom-word.gemspec +3 -3
- data/lib/fandom_word.rb +61 -17
- data/lib/fandom_word_catalog.rb +4 -1
- data/lib/fandoms.rb +43 -6
- data/lib/version.rb +2 -1
- metadata +30 -4
@@ -0,0 +1,419 @@
|
|
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: FandomWord::FandomRandomizer
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "FandomWord::FandomRandomizer";
|
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 (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../FandomWord.html" title="FandomWord (module)">FandomWord</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">FandomRandomizer</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: FandomWord::FandomRandomizer
|
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">FandomWord::FandomRandomizer</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>lib/fandom_word.rb</dd>
|
103
|
+
</dl>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
<h2>Overview</h2><div class="docstring">
|
108
|
+
<div class="discussion">
|
109
|
+
|
110
|
+
<p>Provides singleton interface with fandom word catalog to allow retrieval of
|
111
|
+
random words, random words based on fandoms and list of all available
|
112
|
+
fandoms</p>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<h2>
|
129
|
+
Instance Method Summary
|
130
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
131
|
+
</h2>
|
132
|
+
|
133
|
+
<ul class="summary">
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#available_fandoms-instance_method" title="#available_fandoms (instance method)">#<strong>available_fandoms</strong> ⇒ Object </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<span class="summary_desc"><div class='inline'>
|
153
|
+
<p>Returns the list of fandoms (categories).</p>
|
154
|
+
</div></span>
|
155
|
+
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="public ">
|
160
|
+
<span class="summary_signature">
|
161
|
+
|
162
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ FandomRandomizer </a>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
</span>
|
167
|
+
|
168
|
+
|
169
|
+
<span class="note title constructor">constructor</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<span class="summary_desc"><div class='inline'>
|
179
|
+
<p>Caches word catalog into memory for performance.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#random_word-instance_method" title="#random_word (instance method)">#<strong>random_word</strong>(fandom_name_or_names = random_fandom) ⇒ String </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'>
|
203
|
+
<p>Returns random word from any fandom in catalog.</p>
|
204
|
+
</div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
</ul>
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div id="constructor_details" class="method_details_list">
|
214
|
+
<h2>Constructor Details</h2>
|
215
|
+
|
216
|
+
<div class="method_details first">
|
217
|
+
<h3 class="signature first" id="initialize-instance_method">
|
218
|
+
|
219
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="FandomWord::FandomRandomizer (class)">FandomRandomizer</a></span></tt>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
</h3><div class="docstring">
|
226
|
+
<div class="discussion">
|
227
|
+
|
228
|
+
<p>Caches word catalog into memory for performance</p>
|
229
|
+
|
230
|
+
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
<div class="tags">
|
234
|
+
|
235
|
+
|
236
|
+
</div><table class="source_code">
|
237
|
+
<tr>
|
238
|
+
<td>
|
239
|
+
<pre class="lines">
|
240
|
+
|
241
|
+
|
242
|
+
36
|
243
|
+
37
|
244
|
+
38</pre>
|
245
|
+
</td>
|
246
|
+
<td>
|
247
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word.rb', line 36</span>
|
248
|
+
|
249
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
250
|
+
<span class='id identifier rubyid_load_word_catalog'>load_word_catalog</span>
|
251
|
+
<span class='kw'>end</span></pre>
|
252
|
+
</td>
|
253
|
+
</tr>
|
254
|
+
</table>
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
|
260
|
+
<div id="instance_method_details" class="method_details_list">
|
261
|
+
<h2>Instance Method Details</h2>
|
262
|
+
|
263
|
+
|
264
|
+
<div class="method_details first">
|
265
|
+
<h3 class="signature first" id="available_fandoms-instance_method">
|
266
|
+
|
267
|
+
#<strong>available_fandoms</strong> ⇒ <tt>Object</tt>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</h3><div class="docstring">
|
274
|
+
<div class="discussion">
|
275
|
+
|
276
|
+
<p>Returns the list of fandoms (categories)</p>
|
277
|
+
|
278
|
+
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
<div class="tags">
|
282
|
+
|
283
|
+
|
284
|
+
</div><table class="source_code">
|
285
|
+
<tr>
|
286
|
+
<td>
|
287
|
+
<pre class="lines">
|
288
|
+
|
289
|
+
|
290
|
+
59
|
291
|
+
60
|
292
|
+
61</pre>
|
293
|
+
</td>
|
294
|
+
<td>
|
295
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word.rb', line 59</span>
|
296
|
+
|
297
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_available_fandoms'>available_fandoms</span>
|
298
|
+
<span class='ivar'>@catalog</span><span class='period'>.</span><span class='id identifier rubyid_fandoms'>fandoms</span>
|
299
|
+
<span class='kw'>end</span></pre>
|
300
|
+
</td>
|
301
|
+
</tr>
|
302
|
+
</table>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
<div class="method_details ">
|
306
|
+
<h3 class="signature " id="random_word-instance_method">
|
307
|
+
|
308
|
+
#<strong>random_word</strong>(fandom_name_or_names = random_fandom) ⇒ <tt>String</tt>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
</h3><div class="docstring">
|
315
|
+
<div class="discussion">
|
316
|
+
|
317
|
+
<p>Returns random word from any fandom in catalog. Fandom category can be
|
318
|
+
specified.</p>
|
319
|
+
|
320
|
+
|
321
|
+
</div>
|
322
|
+
</div>
|
323
|
+
<div class="tags">
|
324
|
+
<p class="tag_title">Parameters:</p>
|
325
|
+
<ul class="param">
|
326
|
+
|
327
|
+
<li>
|
328
|
+
|
329
|
+
<span class='name'>fandom_name_or_names</span>
|
330
|
+
|
331
|
+
|
332
|
+
<span class='type'>(<tt>String</tt>, <tt>Array</tt>)</span>
|
333
|
+
|
334
|
+
|
335
|
+
<em class="default">(defaults to: <tt>random_fandom</tt>)</em>
|
336
|
+
|
337
|
+
|
338
|
+
—
|
339
|
+
<div class='inline'>
|
340
|
+
<p>Fandom category or array of categories</p>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
</li>
|
344
|
+
|
345
|
+
</ul>
|
346
|
+
|
347
|
+
<p class="tag_title">Returns:</p>
|
348
|
+
<ul class="return">
|
349
|
+
|
350
|
+
<li>
|
351
|
+
|
352
|
+
|
353
|
+
<span class='type'>(<tt>String</tt>)</span>
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
—
|
358
|
+
<div class='inline'>
|
359
|
+
<p>Random word</p>
|
360
|
+
</div>
|
361
|
+
|
362
|
+
</li>
|
363
|
+
|
364
|
+
</ul>
|
365
|
+
|
366
|
+
</div><table class="source_code">
|
367
|
+
<tr>
|
368
|
+
<td>
|
369
|
+
<pre class="lines">
|
370
|
+
|
371
|
+
|
372
|
+
44
|
373
|
+
45
|
374
|
+
46
|
375
|
+
47
|
376
|
+
48
|
377
|
+
49
|
378
|
+
50
|
379
|
+
51
|
380
|
+
52
|
381
|
+
53
|
382
|
+
54
|
383
|
+
55
|
384
|
+
56</pre>
|
385
|
+
</td>
|
386
|
+
<td>
|
387
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word.rb', line 44</span>
|
388
|
+
|
389
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_random_word'>random_word</span><span class='lparen'>(</span><span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span> <span class='op'>=</span> <span class='id identifier rubyid_random_fandom'>random_fandom</span><span class='rparen'>)</span>
|
390
|
+
<span class='id identifier rubyid_fandom_name'>fandom_name</span> <span class='op'>=</span> <span class='kw'>case</span> <span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span>
|
391
|
+
<span class='kw'>when</span> <span class='const'>Array</span>
|
392
|
+
<span class='id identifier rubyid_validate_fandom_list'>validate_fandom_list</span> <span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span>
|
393
|
+
<span class='id identifier rubyid_random_fandom_name_from'>random_fandom_name_from</span> <span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span>
|
394
|
+
<span class='kw'>when</span> <span class='const'>String</span>
|
395
|
+
<span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span>
|
396
|
+
<span class='kw'>else</span>
|
397
|
+
<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Argument must be [Array, String] not </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_fandom_name_or_names'>fandom_name_or_names</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
398
|
+
<span class='kw'>end</span>
|
399
|
+
|
400
|
+
<span class='id identifier rubyid_fetch_fandom'>fetch_fandom</span> <span class='id identifier rubyid_fandom_name'>fandom_name</span>
|
401
|
+
<span class='kw'>end</span></pre>
|
402
|
+
</td>
|
403
|
+
</tr>
|
404
|
+
</table>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</div>
|
408
|
+
|
409
|
+
</div>
|
410
|
+
|
411
|
+
<div id="footer">
|
412
|
+
Generated on Sun Nov 19 16:39:22 2017 by
|
413
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
414
|
+
0.9.9 (ruby-2.3.3).
|
415
|
+
</div>
|
416
|
+
|
417
|
+
</div>
|
418
|
+
</body>
|
419
|
+
</html>
|
@@ -0,0 +1,424 @@
|
|
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: FandomWord::FandomWordCatalog
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "FandomWord::FandomWordCatalog";
|
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 (F)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../FandomWord.html" title="FandomWord (module)">FandomWord</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">FandomWordCatalog</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: FandomWord::FandomWordCatalog
|
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">FandomWord::FandomWordCatalog</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>lib/fandom_word_catalog.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>FandomWordCatalog is a catalog holding all words in groups of fandoms.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>
|
122
|
+
Instance Method Summary
|
123
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
124
|
+
</h2>
|
125
|
+
|
126
|
+
<ul class="summary">
|
127
|
+
|
128
|
+
<li class="public ">
|
129
|
+
<span class="summary_signature">
|
130
|
+
|
131
|
+
<a href="#add_word-instance_method" title="#add_word (instance method)">#<strong>add_word</strong>(new_word, categories) ⇒ Object </a>
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
</span>
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
146
|
+
<p>Adds a word to a fandom.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
<li class="public ">
|
153
|
+
<span class="summary_signature">
|
154
|
+
|
155
|
+
<a href="#fandoms-instance_method" title="#fandoms (instance method)">#<strong>fandoms</strong> ⇒ Object </a>
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
</span>
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
<span class="summary_desc"><div class='inline'>
|
170
|
+
<p>Returns the list of fandoms (categories).</p>
|
171
|
+
</div></span>
|
172
|
+
|
173
|
+
</li>
|
174
|
+
|
175
|
+
|
176
|
+
<li class="public ">
|
177
|
+
<span class="summary_signature">
|
178
|
+
|
179
|
+
<a href="#fetch_fandom-instance_method" title="#fetch_fandom (instance method)">#<strong>fetch_fandom</strong>(fandom) ⇒ Object </a>
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<span class="summary_desc"><div class='inline'>
|
194
|
+
<p>Returns an array of words associated with the specified fandom.</p>
|
195
|
+
</div></span>
|
196
|
+
|
197
|
+
</li>
|
198
|
+
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong> ⇒ FandomWordCatalog </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
<span class="note title constructor">constructor</span>
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
<span class="summary_desc"><div class='inline'>
|
220
|
+
<p>A new instance of FandomWordCatalog.</p>
|
221
|
+
</div></span>
|
222
|
+
|
223
|
+
</li>
|
224
|
+
|
225
|
+
|
226
|
+
</ul>
|
227
|
+
|
228
|
+
|
229
|
+
<div id="constructor_details" class="method_details_list">
|
230
|
+
<h2>Constructor Details</h2>
|
231
|
+
|
232
|
+
<div class="method_details first">
|
233
|
+
<h3 class="signature first" id="initialize-instance_method">
|
234
|
+
|
235
|
+
#<strong>initialize</strong> ⇒ <tt><span class='object_link'><a href="" title="FandomWord::FandomWordCatalog (class)">FandomWordCatalog</a></span></tt>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
</h3><div class="docstring">
|
242
|
+
<div class="discussion">
|
243
|
+
|
244
|
+
<p>Returns a new instance of FandomWordCatalog</p>
|
245
|
+
|
246
|
+
|
247
|
+
</div>
|
248
|
+
</div>
|
249
|
+
<div class="tags">
|
250
|
+
|
251
|
+
|
252
|
+
</div><table class="source_code">
|
253
|
+
<tr>
|
254
|
+
<td>
|
255
|
+
<pre class="lines">
|
256
|
+
|
257
|
+
|
258
|
+
4
|
259
|
+
5
|
260
|
+
6</pre>
|
261
|
+
</td>
|
262
|
+
<td>
|
263
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word_catalog.rb', line 4</span>
|
264
|
+
|
265
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
266
|
+
<span class='ivar'>@fandoms</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
267
|
+
<span class='kw'>end</span></pre>
|
268
|
+
</td>
|
269
|
+
</tr>
|
270
|
+
</table>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
|
276
|
+
<div id="instance_method_details" class="method_details_list">
|
277
|
+
<h2>Instance Method Details</h2>
|
278
|
+
|
279
|
+
|
280
|
+
<div class="method_details first">
|
281
|
+
<h3 class="signature first" id="add_word-instance_method">
|
282
|
+
|
283
|
+
#<strong>add_word</strong>(new_word, categories) ⇒ <tt>Object</tt>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</h3><div class="docstring">
|
290
|
+
<div class="discussion">
|
291
|
+
|
292
|
+
<p>Adds a word to a fandom</p>
|
293
|
+
|
294
|
+
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
<div class="tags">
|
298
|
+
|
299
|
+
|
300
|
+
</div><table class="source_code">
|
301
|
+
<tr>
|
302
|
+
<td>
|
303
|
+
<pre class="lines">
|
304
|
+
|
305
|
+
|
306
|
+
15
|
307
|
+
16
|
308
|
+
17
|
309
|
+
18
|
310
|
+
19
|
311
|
+
20</pre>
|
312
|
+
</td>
|
313
|
+
<td>
|
314
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word_catalog.rb', line 15</span>
|
315
|
+
|
316
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_word'>add_word</span><span class='lparen'>(</span><span class='id identifier rubyid_new_word'>new_word</span><span class='comma'>,</span> <span class='id identifier rubyid_categories'>categories</span><span class='rparen'>)</span>
|
317
|
+
<span class='id identifier rubyid_categories'>categories</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_category'>category</span><span class='op'>|</span>
|
318
|
+
<span class='id identifier rubyid_fandom'>fandom</span> <span class='op'>=</span> <span class='id identifier rubyid_fetch_fandom'>fetch_fandom</span><span class='lparen'>(</span><span class='id identifier rubyid_category'>category</span><span class='rparen'>)</span>
|
319
|
+
<span class='id identifier rubyid_fandom'>fandom</span> <span class='op'><<</span> <span class='id identifier rubyid_new_word'>new_word</span> <span class='kw'>unless</span> <span class='id identifier rubyid_fandom'>fandom</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_new_word'>new_word</span>
|
320
|
+
<span class='kw'>end</span>
|
321
|
+
<span class='kw'>end</span></pre>
|
322
|
+
</td>
|
323
|
+
</tr>
|
324
|
+
</table>
|
325
|
+
</div>
|
326
|
+
|
327
|
+
<div class="method_details ">
|
328
|
+
<h3 class="signature " id="fandoms-instance_method">
|
329
|
+
|
330
|
+
#<strong>fandoms</strong> ⇒ <tt>Object</tt>
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
</h3><div class="docstring">
|
337
|
+
<div class="discussion">
|
338
|
+
|
339
|
+
<p>Returns the list of fandoms (categories)</p>
|
340
|
+
|
341
|
+
|
342
|
+
</div>
|
343
|
+
</div>
|
344
|
+
<div class="tags">
|
345
|
+
|
346
|
+
|
347
|
+
</div><table class="source_code">
|
348
|
+
<tr>
|
349
|
+
<td>
|
350
|
+
<pre class="lines">
|
351
|
+
|
352
|
+
|
353
|
+
23
|
354
|
+
24
|
355
|
+
25</pre>
|
356
|
+
</td>
|
357
|
+
<td>
|
358
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word_catalog.rb', line 23</span>
|
359
|
+
|
360
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fandoms'>fandoms</span>
|
361
|
+
<span class='ivar'>@fandoms</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span>
|
362
|
+
<span class='kw'>end</span></pre>
|
363
|
+
</td>
|
364
|
+
</tr>
|
365
|
+
</table>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
<div class="method_details ">
|
369
|
+
<h3 class="signature " id="fetch_fandom-instance_method">
|
370
|
+
|
371
|
+
#<strong>fetch_fandom</strong>(fandom) ⇒ <tt>Object</tt>
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
</h3><div class="docstring">
|
378
|
+
<div class="discussion">
|
379
|
+
|
380
|
+
<p>Returns an array of words associated with the specified fandom. Initializes
|
381
|
+
fandom in catalog if not present.</p>
|
382
|
+
|
383
|
+
|
384
|
+
</div>
|
385
|
+
</div>
|
386
|
+
<div class="tags">
|
387
|
+
|
388
|
+
|
389
|
+
</div><table class="source_code">
|
390
|
+
<tr>
|
391
|
+
<td>
|
392
|
+
<pre class="lines">
|
393
|
+
|
394
|
+
|
395
|
+
9
|
396
|
+
10
|
397
|
+
11
|
398
|
+
12</pre>
|
399
|
+
</td>
|
400
|
+
<td>
|
401
|
+
<pre class="code"><span class="info file"># File 'lib/fandom_word_catalog.rb', line 9</span>
|
402
|
+
|
403
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fetch_fandom'>fetch_fandom</span><span class='lparen'>(</span><span class='id identifier rubyid_fandom'>fandom</span><span class='rparen'>)</span>
|
404
|
+
<span class='comment'># grab the category if it exists, if not make it empty array
|
405
|
+
</span> <span class='ivar'>@fandoms</span><span class='period'>.</span><span class='id identifier rubyid_keys'>keys</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='id identifier rubyid_fandom'>fandom</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='ivar'>@fandoms</span><span class='lbracket'>[</span><span class='id identifier rubyid_fandom'>fandom</span><span class='rbracket'>]</span> <span class='op'>:</span> <span class='ivar'>@fandoms</span><span class='lbracket'>[</span><span class='id identifier rubyid_fandom'>fandom</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
406
|
+
<span class='kw'>end</span></pre>
|
407
|
+
</td>
|
408
|
+
</tr>
|
409
|
+
</table>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
</div>
|
413
|
+
|
414
|
+
</div>
|
415
|
+
|
416
|
+
<div id="footer">
|
417
|
+
Generated on Sun Nov 19 16:39:22 2017 by
|
418
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
419
|
+
0.9.9 (ruby-2.3.3).
|
420
|
+
</div>
|
421
|
+
|
422
|
+
</div>
|
423
|
+
</body>
|
424
|
+
</html>
|