]>
Commit | Line | Data |
---|---|---|
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
4 | <head> | |
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
6 | <title> | |
7 | Class: Lyricli::Lyricli | |
8 | ||
9 | — Documentation by YARD 0.8.2.1 | |
10 | ||
11 | </title> | |
12 | ||
13 | <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" /> | |
14 | ||
15 | <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" /> | |
16 | ||
17 | <script type="text/javascript" charset="utf-8"> | |
18 | hasFrames = window.top.frames.main ? true : false; | |
19 | relpath = '../'; | |
20 | framesUrl = "../frames.html#!" + escape(window.location.href); | |
21 | </script> | |
22 | ||
23 | ||
24 | <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script> | |
25 | ||
26 | <script type="text/javascript" charset="utf-8" src="../js/app.js"></script> | |
27 | ||
28 | ||
29 | </head> | |
30 | <body> | |
31 | <div id="header"> | |
32 | <div id="menu"> | |
33 | ||
34 | <a href="../_index.html">Index (L)</a> » | |
35 | <span class='title'><span class='object_link'><a href="../Lyricli.html" title="Lyricli (module)">Lyricli</a></span></span> | |
36 | » | |
37 | <span class="title">Lyricli</span> | |
38 | ||
39 | ||
40 | <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> | |
41 | </div> | |
42 | ||
43 | <div id="search"> | |
44 | ||
45 | <a class="full_list_link" id="class_list_link" | |
46 | href="../class_list.html"> | |
47 | Class List | |
48 | </a> | |
49 | ||
50 | <a class="full_list_link" id="method_list_link" | |
51 | href="../method_list.html"> | |
52 | Method List | |
53 | </a> | |
54 | ||
55 | <a class="full_list_link" id="file_list_link" | |
56 | href="../file_list.html"> | |
57 | File List | |
58 | </a> | |
59 | ||
60 | </div> | |
61 | <div class="clear"></div> | |
62 | </div> | |
63 | ||
64 | <iframe id="search_frame"></iframe> | |
65 | ||
66 | <div id="content"><h1>Class: Lyricli::Lyricli | |
67 | ||
68 | ||
69 | ||
70 | </h1> | |
71 | ||
72 | <dl class="box"> | |
73 | ||
74 | <dt class="r1">Inherits:</dt> | |
75 | <dd class="r1"> | |
76 | <span class="inheritName">Object</span> | |
77 | ||
78 | <ul class="fullTree"> | |
79 | <li>Object</li> | |
80 | ||
81 | <li class="next">Lyricli::Lyricli</li> | |
82 | ||
83 | </ul> | |
84 | <a href="#" class="inheritanceTree">show all</a> | |
85 | ||
86 | </dd> | |
87 | ||
88 | ||
89 | ||
90 | ||
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 | <dt class="r2 last">Defined in:</dt> | |
97 | <dd class="r2 last">lib/lyricli/lyricli.rb</dd> | |
98 | ||
99 | </dl> | |
100 | <div class="clear"></div> | |
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
110 | <h2> | |
111 | Instance Method Summary | |
112 | <small>(<a href="#" class="summary_toggle">collapse</a>)</small> | |
113 | </h2> | |
114 | ||
115 | <ul class="summary"> | |
116 | ||
117 | <li class="public "> | |
118 | <span class="summary_signature"> | |
119 | ||
120 | <a href="#check_params-instance_method" title="#check_params (instance method)">- (Object) <strong>check_params</strong> </a> | |
121 | ||
122 | ||
123 | ||
124 | </span> | |
125 | ||
126 | ||
127 | ||
128 | ||
129 | ||
130 | ||
131 | ||
132 | ||
133 | ||
134 | <span class="summary_desc"><div class='inline'></div></span> | |
135 | ||
136 | </li> | |
137 | ||
138 | ||
139 | <li class="public "> | |
140 | <span class="summary_signature"> | |
141 | ||
142 | <a href="#exit_with_error-instance_method" title="#exit_with_error (instance method)">- (Object) <strong>exit_with_error</strong> </a> | |
143 | ||
144 | ||
145 | ||
146 | </span> | |
147 | ||
148 | ||
149 | ||
150 | ||
151 | ||
152 | ||
153 | ||
154 | ||
155 | ||
156 | <span class="summary_desc"><div class='inline'></div></span> | |
157 | ||
158 | </li> | |
159 | ||
160 | ||
161 | <li class="public "> | |
162 | <span class="summary_signature"> | |
163 | ||
164 | <a href="#get_lyrics-instance_method" title="#get_lyrics (instance method)">- (Object) <strong>get_lyrics</strong> </a> | |
165 | ||
166 | ||
167 | ||
168 | </span> | |
169 | ||
170 | ||
171 | ||
172 | ||
173 | ||
174 | ||
175 | ||
176 | ||
177 | ||
178 | <span class="summary_desc"><div class='inline'></div></span> | |
179 | ||
180 | </li> | |
181 | ||
182 | ||
183 | <li class="public "> | |
184 | <span class="summary_signature"> | |
185 | ||
186 | <a href="#initialize-instance_method" title="#initialize (instance method)">- (Lyricli) <strong>initialize</strong> </a> | |
187 | ||
188 | ||
189 | ||
190 | </span> | |
191 | ||
192 | ||
193 | <span class="note title constructor">constructor</span> | |
194 | ||
195 | ||
196 | ||
197 | ||
198 | ||
199 | ||
200 | ||
201 | ||
202 | <span class="summary_desc"><div class='inline'><p> | |
203 | A new instance of Lyricli. | |
204 | </p> | |
205 | </div></span> | |
206 | ||
207 | </li> | |
208 | ||
209 | ||
210 | <li class="public "> | |
211 | <span class="summary_signature"> | |
212 | ||
213 | <a href="#set_current_track-instance_method" title="#set_current_track (instance method)">- (Object) <strong>set_current_track</strong> </a> | |
214 | ||
215 | ||
216 | ||
217 | </span> | |
218 | ||
219 | ||
220 | ||
221 | ||
222 | ||
223 | ||
224 | ||
225 | ||
226 | ||
227 | <span class="summary_desc"><div class='inline'></div></span> | |
228 | ||
229 | </li> | |
230 | ||
231 | ||
232 | </ul> | |
233 | ||
234 | ||
235 | <div id="constructor_details" class="method_details_list"> | |
236 | <h2>Constructor Details</h2> | |
237 | ||
238 | <div class="method_details first"> | |
239 | <h3 class="signature first" id="initialize-instance_method"> | |
240 | ||
241 | - (<tt><span class='object_link'><a href="" title="Lyricli::Lyricli (class)">Lyricli</a></span></tt>) <strong>initialize</strong> | |
242 | ||
243 | ||
244 | ||
245 | ||
246 | ||
247 | </h3><div class="docstring"> | |
248 | <div class="discussion"> | |
249 | <p> | |
250 | A new instance of Lyricli | |
251 | </p> | |
252 | ||
253 | ||
254 | </div> | |
255 | </div> | |
256 | <div class="tags"> | |
257 | ||
258 | ||
259 | </div><table class="source_code"> | |
260 | <tr> | |
261 | <td> | |
262 | <pre class="lines"> | |
263 | ||
264 | ||
265 | 4 | |
266 | 5 | |
267 | 6</pre> | |
268 | </td> | |
269 | <td> | |
270 | <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 4</span> | |
271 | ||
272 | <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> | |
273 | <span class='ivar'>@source_manager</span> <span class='op'>=</span> <span class='const'>SourceManager</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> | |
274 | <span class='kw'>end</span></pre> | |
275 | </td> | |
276 | </tr> | |
277 | </table> | |
278 | </div> | |
279 | ||
280 | </div> | |
281 | ||
282 | ||
283 | <div id="instance_method_details" class="method_details_list"> | |
284 | <h2>Instance Method Details</h2> | |
285 | ||
286 | ||
287 | <div class="method_details first"> | |
288 | <h3 class="signature first" id="check_params-instance_method"> | |
289 | ||
290 | - (<tt>Object</tt>) <strong>check_params</strong> | |
291 | ||
292 | ||
293 | ||
294 | ||
295 | ||
296 | </h3><table class="source_code"> | |
297 | <tr> | |
298 | <td> | |
299 | <pre class="lines"> | |
300 | ||
301 | ||
302 | 29 | |
303 | 30 | |
304 | 31 | |
305 | 32</pre> | |
306 | </td> | |
307 | <td> | |
308 | <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 29</span> | |
309 | ||
310 | <span class='kw'>def</span> <span class='id identifier rubyid_check_params'>check_params</span> | |
311 | <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exit_with_error'>exit_with_error</span> <span class='kw'>if</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> | |
312 | <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exit_with_error'>exit_with_error</span> <span class='kw'>if</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='kw'>or</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> | |
313 | <span class='kw'>end</span></pre> | |
314 | </td> | |
315 | </tr> | |
316 | </table> | |
317 | </div> | |
318 | ||
319 | <div class="method_details "> | |
320 | <h3 class="signature " id="exit_with_error-instance_method"> | |
321 | ||
322 | - (<tt>Object</tt>) <strong>exit_with_error</strong> | |
323 | ||
324 | ||
325 | ||
326 | ||
327 | ||
328 | </h3><div class="docstring"> | |
329 | <div class="discussion"> | |
330 | ||
331 | ||
332 | </div> | |
333 | </div> | |
334 | <div class="tags"> | |
335 | ||
336 | <p class="tag_title">Raises:</p> | |
337 | <ul class="raise"> | |
338 | ||
339 | <li> | |
340 | ||
341 | ||
342 | <span class='type'>(<tt>InvalidLyrics</tt>)</span> | |
343 | ||
344 | ||
345 | ||
346 | </li> | |
347 | ||
348 | </ul> | |
349 | ||
350 | </div><table class="source_code"> | |
351 | <tr> | |
352 | <td> | |
353 | <pre class="lines"> | |
354 | ||
355 | ||
356 | 8 | |
357 | 9 | |
358 | 10</pre> | |
359 | </td> | |
360 | <td> | |
361 | <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 8</span> | |
362 | ||
363 | <span class='kw'>def</span> <span class='id identifier rubyid_exit_with_error'>exit_with_error</span> | |
364 | <span class='id identifier rubyid_raise'>raise</span> <span class='const'>InvalidLyrics</span> | |
365 | <span class='kw'>end</span></pre> | |
366 | </td> | |
367 | </tr> | |
368 | </table> | |
369 | </div> | |
370 | ||
371 | <div class="method_details "> | |
372 | <h3 class="signature " id="get_lyrics-instance_method"> | |
373 | ||
374 | - (<tt>Object</tt>) <strong>get_lyrics</strong> | |
375 | ||
376 | ||
377 | ||
378 | ||
379 | ||
380 | </h3><table class="source_code"> | |
381 | <tr> | |
382 | <td> | |
383 | <pre class="lines"> | |
384 | ||
385 | ||
386 | 12 | |
387 | 13 | |
388 | 14 | |
389 | 15 | |
390 | 16 | |
391 | 17 | |
392 | 18 | |
393 | 19 | |
394 | 20 | |
395 | 21 | |
396 | 22 | |
397 | 23</pre> | |
398 | </td> | |
399 | <td> | |
400 | <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 12</span> | |
401 | ||
402 | <span class='kw'>def</span> <span class='id identifier rubyid_get_lyrics'>get_lyrics</span> | |
403 | <span class='id identifier rubyid_set_current_track'>set_current_track</span> | |
404 | <span class='id identifier rubyid_check_params'>check_params</span> | |
405 | ||
406 | <span class='id identifier rubyid_engine'>engine</span> <span class='op'>=</span> <span class='const'>LyricsEngine</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:artist</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='ivar'>@current_track</span><span class='lbracket'>[</span><span class='symbol'>:song</span><span class='rbracket'>]</span><span class='rparen'>)</span> | |
407 | ||
408 | <span class='kw'>begin</span> | |
409 | <span class='id identifier rubyid_engine'>engine</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span> | |
410 | <span class='kw'>rescue</span> <span class='const'>LyricsNotFoundException</span> | |
411 | <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lyrics not found :(</span><span class='tstring_end'>"</span></span> | |
412 | <span class='kw'>end</span> | |
413 | <span class='kw'>end</span></pre> | |
414 | </td> | |
415 | </tr> | |
416 | </table> | |
417 | </div> | |
418 | ||
419 | <div class="method_details "> | |
420 | <h3 class="signature " id="set_current_track-instance_method"> | |
421 | ||
422 | - (<tt>Object</tt>) <strong>set_current_track</strong> | |
423 | ||
424 | ||
425 | ||
426 | ||
427 | ||
428 | </h3><table class="source_code"> | |
429 | <tr> | |
430 | <td> | |
431 | <pre class="lines"> | |
432 | ||
433 | ||
434 | 25 | |
435 | 26 | |
436 | 27</pre> | |
437 | </td> | |
438 | <td> | |
439 | <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 25</span> | |
440 | ||
441 | <span class='kw'>def</span> <span class='id identifier rubyid_set_current_track'>set_current_track</span> | |
442 | <span class='ivar'>@current_track</span> <span class='op'>=</span> <span class='ivar'>@source_manager</span><span class='period'>.</span><span class='id identifier rubyid_current_track'>current_track</span> | |
443 | <span class='kw'>end</span></pre> | |
444 | </td> | |
445 | </tr> | |
446 | </table> | |
447 | </div> | |
448 | ||
449 | </div> | |
450 | ||
451 | </div> | |
452 | ||
453 | <div id="footer"> | |
454 | Generated on Sat Oct 6 02:05:51 2012 by | |
455 | <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> | |
456 | 0.8.2.1 (ruby-1.9.2). | |
457 | </div> | |
458 | ||
459 | </body> | |
460 | </html> |