<span class="summary_desc"><div class='inline'><p>
-Raises an InvalidLyricsException which means we did not get any valid
+Raises an InvalidLyricsError which means we did not get any valid
artist/song from any of the sources.
</p>
</div></span>
<pre class="lines">
-44
-45
-46
-47</pre>
+49
+50
+51
+52
+53</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 44</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 49</span>
<span class='kw'>def</span> <span class='id identifier rubyid_check_params'>check_params</span>
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_exit_with_error'>exit_with_error</span> <span class='kw'>unless</span> <span class='ivar'>@current_track</span>
<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>
<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>
<span class='kw'>end</span></pre>
</h3><div class="docstring">
<div class="discussion">
<p>
-Raises an InvalidLyricsException which means we did not get any valid
+Raises an InvalidLyricsError which means we did not get any valid
artist/song from any of the sources
</p>
<li>
- <span class='type'>(<tt>Lyricli::InvalidLyricsException</tt>)</span>
+ <span class='type'>(<tt><span class='object_link'><a href="Exceptions/InvalidLyricsError.html" title="Lyricli::Exceptions::InvalidLyricsError (class)">Lyricli::Exceptions::InvalidLyricsError</a></span></tt>)</span>
<pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 16</span>
<span class='kw'>def</span> <span class='id identifier rubyid_exit_with_error'>exit_with_error</span>
- <span class='id identifier rubyid_raise'>raise</span> <span class='const'>InvalidLyricsException</span>
+ <span class='id identifier rubyid_raise'>raise</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>InvalidLyricsError</span>
<span class='kw'>end</span></pre>
</td>
</tr>
32
33
34
-35</pre>
+35
+36
+37
+38
+39
+40</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 24</span>
<span class='kw'>def</span> <span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
- <span class='id identifier rubyid_set_current_track'>set_current_track</span>
- <span class='id identifier rubyid_check_params'>check_params</span>
+
+ <span class='kw'>begin</span>
+ <span class='id identifier rubyid_set_current_track'>set_current_track</span>
+ <span class='id identifier rubyid_check_params'>check_params</span>
+ <span class='kw'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>InvalidLyricsError</span>
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>No Artist/Song could be found :(</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>end</span>
<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>
<span class='kw'>begin</span>
- <span class='id identifier rubyid_engine'>engine</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
- <span class='kw'>rescue</span> <span class='const'>LyricsNotFoundException</span>
- <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lyrics not found :(</span><span class='tstring_end'>"</span></span>
+ <span class='kw'>return</span> <span class='id identifier rubyid_engine'>engine</span><span class='period'>.</span><span class='id identifier rubyid_get_lyrics'>get_lyrics</span>
+ <span class='kw'>rescue</span> <span class='const'>Exceptions</span><span class='op'>::</span><span class='const'>LyricsNotFoundError</span>
+ <span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Lyrics not found :(</span><span class='tstring_end'>"</span></span>
<span class='kw'>end</span>
<span class='kw'>end</span></pre>
</td>
<pre class="lines">
-39
-40
-41</pre>
+44
+45
+46</pre>
</td>
<td>
- <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 39</span>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/lyricli.rb', line 44</span>
<span class='kw'>def</span> <span class='id identifier rubyid_set_current_track'>set_current_track</span>
<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>
</div>
<div id="footer">
- Generated on Sat Oct 6 02:34:27 2012 by
+ Generated on Sat Oct 6 03:20:24 2012 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.8.2.1 (ruby-1.9.2).
</div>