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">
5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
7 Class: Lyricli::Lyricli
9 — Documentation by YARD
0.8.2.1
13 <link rel=
"stylesheet" href=
"../css/style.css" type=
"text/css" media=
"screen" charset=
"utf-8" />
15 <link rel=
"stylesheet" href=
"../css/common.css" type=
"text/css" media=
"screen" charset=
"utf-8" />
17 <script type=
"text/javascript" charset=
"utf-8">
18 hasFrames = window.top.frames.main ? true : false;
20 framesUrl = "../frames.html#!" + escape(window.location.href);
24 <script type=
"text/javascript" charset=
"utf-8" src=
"../js/jquery.js"></script>
26 <script type=
"text/javascript" charset=
"utf-8" src=
"../js/app.js"></script>
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>
37 <span class=
"title">Lyricli
</span>
40 <div class=
"noframes"><span class=
"title">(
</span><a href=
"." target=
"_top">no frames
</a><span class=
"title">)
</span></div>
45 <a class=
"full_list_link" id=
"class_list_link"
46 href=
"../class_list.html">
50 <a class=
"full_list_link" id=
"method_list_link"
51 href=
"../method_list.html">
55 <a class=
"full_list_link" id=
"file_list_link"
56 href=
"../file_list.html">
61 <div class=
"clear"></div>
64 <iframe id=
"search_frame"></iframe>
66 <div id=
"content"><h1>Class: Lyricli::Lyricli
74 <dt class=
"r1">Inherits:
</dt>
76 <span class=
"inheritName">Object
</span>
81 <li class=
"next">Lyricli::Lyricli
</li>
84 <a href=
"#" class=
"inheritanceTree">show all
</a>
96 <dt class=
"r2 last">Defined in:
</dt>
97 <dd class=
"r2 last">lib/lyricli/lyricli.rb
</dd>
100 <div class=
"clear"></div>
111 Instance Method Summary
112 <small>(
<a href=
"#" class=
"summary_toggle">collapse
</a>)
</small>
118 <span class=
"summary_signature">
120 <a href=
"#check_params-instance_method" title=
"#check_params (instance method)">- (Object)
<strong>check_params
</strong> </a>
134 <span class=
"summary_desc"><div class='inline'
></div></span>
140 <span class=
"summary_signature">
142 <a href=
"#exit_with_error-instance_method" title=
"#exit_with_error (instance method)">- (Object)
<strong>exit_with_error
</strong> </a>
156 <span class=
"summary_desc"><div class='inline'
></div></span>
162 <span class=
"summary_signature">
164 <a href=
"#get_lyrics-instance_method" title=
"#get_lyrics (instance method)">- (Object)
<strong>get_lyrics
</strong> </a>
178 <span class=
"summary_desc"><div class='inline'
></div></span>
184 <span class=
"summary_signature">
186 <a href=
"#initialize-instance_method" title=
"#initialize (instance method)">- (Lyricli)
<strong>initialize
</strong> </a>
193 <span class=
"note title constructor">constructor
</span>
202 <span class=
"summary_desc"><div class='inline'
><p>
203 A new instance of Lyricli.
211 <span class=
"summary_signature">
213 <a href=
"#set_current_track-instance_method" title=
"#set_current_track (instance method)">- (Object)
<strong>set_current_track
</strong> </a>
227 <span class=
"summary_desc"><div class='inline'
></div></span>
235 <div id=
"constructor_details" class=
"method_details_list">
236 <h2>Constructor Details
</h2>
238 <div class=
"method_details first">
239 <h3 class=
"signature first" id=
"initialize-instance_method">
241 - (
<tt><span class='object_link'
><a href=
"" title=
"Lyricli::Lyricli (class)">Lyricli
</a></span></tt>)
<strong>initialize
</strong>
247 </h3><div class=
"docstring">
248 <div class=
"discussion">
250 A new instance of Lyricli
259 </div><table class=
"source_code">
270 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/lyricli.rb', line
4</span>
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>
283 <div id=
"instance_method_details" class=
"method_details_list">
284 <h2>Instance Method Details
</h2>
287 <div class=
"method_details first">
288 <h3 class=
"signature first" id=
"check_params-instance_method">
290 - (
<tt>Object
</tt>)
<strong>check_params
</strong>
296 </h3><table class=
"source_code">
308 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/lyricli.rb', line
29</span>
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>
319 <div class=
"method_details ">
320 <h3 class=
"signature " id=
"exit_with_error-instance_method">
322 - (
<tt>Object
</tt>)
<strong>exit_with_error
</strong>
328 </h3><div class=
"docstring">
329 <div class=
"discussion">
336 <p class=
"tag_title">Raises:
</p>
342 <span class='type'
>(
<tt>InvalidLyrics
</tt>)
</span>
350 </div><table class=
"source_code">
361 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/lyricli.rb', line
8</span>
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>
371 <div class=
"method_details ">
372 <h3 class=
"signature " id=
"get_lyrics-instance_method">
374 - (
<tt>Object
</tt>)
<strong>get_lyrics
</strong>
380 </h3><table class=
"source_code">
400 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/lyricli.rb', line
12</span>
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>
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>
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>
419 <div class=
"method_details ">
420 <h3 class=
"signature " id=
"set_current_track-instance_method">
422 - (
<tt>Object
</tt>)
<strong>set_current_track
</strong>
428 </h3><table class=
"source_code">
439 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/lyricli.rb', line
25</span>
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>
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).