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" />
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> »
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>Module: Lyricli
81 <dt class=
"r1 last">Defined in:
</dt>
82 <dd class=
"r1 last">lib/lyricli.rb
<span class=
"defines">,
<br />
83 lib/lyricli/util.rb,
<br /> lib/lyricli/sources.rb,
<br /> lib/lyricli/lyricli.rb,
<br /> lib/lyricli/exceptions.rb,
<br /> lib/lyricli/sources/rdio.rb,
<br /> lib/lyricli/configuration.rb,
<br /> lib/lyricli/lyrics_engine.rb,
<br /> lib/lyricli/sources/itunes.rb,
<br /> lib/lyricli/source_manager.rb,
<br /> lib/lyricli/sources/arguments.rb,
<br /> lib/lyricli/exceptions/reset_source_error.rb,
<br /> lib/lyricli/exceptions/start_source_error.rb,
<br /> lib/lyricli/exceptions/enable_source_error.rb,
<br /> lib/lyricli/exceptions/unknown_source_error.rb,
<br /> lib/lyricli/exceptions/invalid_lyrics_error.rb,
<br /> lib/lyricli/exceptions/disable_source_error.rb,
<br /> lib/lyricli/exceptions/lyrics_not_found_error.rb,
<br /> lib/lyricli/exceptions/source_configuration_error.rb
</span>
87 <div class=
"clear"></div>
89 <h2>Overview
</h2><div class=
"docstring">
90 <div class=
"discussion">
92 The Lyricli module allows you to easily search for lyrics by looking for
93 song and artist data from diverse sources.
102 </div><h2>Defined Under Namespace
</h2>
106 <strong class=
"modules">Modules:
</strong> <span class='object_link'
><a href=
"Lyricli/Exceptions.html" title=
"Lyricli::Exceptions (module)">Exceptions
</a></span>,
<span class='object_link'
><a href=
"Lyricli/Sources.html" title=
"Lyricli::Sources (module)">Sources
</a></span>,
<span class='object_link'
><a href=
"Lyricli/Util.html" title=
"Lyricli::Util (module)">Util
</a></span>
110 <strong class=
"classes">Classes:
</strong> <span class='object_link'
><a href=
"Lyricli/Configuration.html" title=
"Lyricli::Configuration (class)">Configuration
</a></span>,
<span class='object_link'
><a href=
"Lyricli/Lyricli.html" title=
"Lyricli::Lyricli (class)">Lyricli
</a></span>,
<span class='object_link'
><a href=
"Lyricli/LyricsEngine.html" title=
"Lyricli::LyricsEngine (class)">LyricsEngine
</a></span>,
<span class='object_link'
><a href=
"Lyricli/SourceManager.html" title=
"Lyricli::SourceManager (class)">SourceManager
</a></span>
124 <small>(
<a href=
"#" class=
"summary_toggle">collapse
</a>)
</small>
130 <span class=
"summary_signature">
132 <a href=
"#disable-class_method" title=
"disable (class method)">+ (Object)
<strong>disable
</strong>(source_name)
</a>
146 <span class=
"summary_desc"><div class='inline'
><p>
147 Disables a source via the Source Manager.
155 <span class=
"summary_signature">
157 <a href=
"#enable-class_method" title=
"enable (class method)">+ (Object)
<strong>enable
</strong>(source_name)
</a>
171 <span class=
"summary_desc"><div class='inline'
><p>
172 Enables a source via the Source Manager.
180 <span class=
"summary_signature">
182 <a href=
"#lyrics-class_method" title=
"lyrics (class method)">+ (String)
<strong>lyrics
</strong> </a>
196 <span class=
"summary_desc"><div class='inline'
><p>
197 Creates a new Lyricli instance and returns lyrics by going through the
206 <span class=
"summary_signature">
208 <a href=
"#reset-class_method" title=
"reset (class method)">+ (Object)
<strong>reset
</strong>(source_name)
</a>
222 <span class=
"summary_desc"><div class='inline'
><p>
223 Resets all configuration for a source via the Source Manager.
231 <span class=
"summary_signature">
233 <a href=
"#sources-class_method" title=
"sources (class method)">+ (String)
<strong>sources
</strong> </a>
247 <span class=
"summary_desc"><div class='inline'
><p>
248 Returns a list of the available sources to enable or disable.
256 <span class=
"summary_signature">
258 <a href=
"#version-class_method" title=
"version (class method)">+ (String)
<strong>version
</strong> </a>
272 <span class=
"summary_desc"><div class='inline'
><p>
273 Returns the version of the library.
285 <div id=
"class_method_details" class=
"method_details_list">
286 <h2>Class Method Details
</h2>
289 <div class=
"method_details first">
290 <h3 class=
"signature first" id=
"disable-class_method">
292 + (
<tt>Object
</tt>)
<strong>disable
</strong>(source_name)
298 </h3><div class=
"docstring">
299 <div class=
"discussion">
301 Disables a source via the Source Manager
310 </div><table class=
"source_code">
326 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
70</span>
328 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_disable'
>disable
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
329 <span class='id identifier rubyid_source_manager'
>source_manager
</span> <span class='op'
>=
</span> <span class='const'
>SourceManager
</span><span class='period'
>.
</span><span class='id identifier rubyid_new'
>new
</span>
330 <span class='kw'
>begin
</span>
331 <span class='id identifier rubyid_source_manager'
>source_manager
</span><span class='period'
>.
</span><span class='id identifier rubyid_disable'
>disable
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
332 <span class='kw'
>rescue
</span> <span class='const'
>Exceptions
</span><span class='op'
>::
</span><span class='const'
>UnknownSourceError
</span>
333 <span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
>There is no such Source
</span><span class='tstring_end'
>"</span></span>
334 <span class='kw'
>end
</span>
335 <span class='kw'
>end
</span></pre>
341 <div class=
"method_details ">
342 <h3 class=
"signature " id=
"enable-class_method">
344 + (
<tt>Object
</tt>)
<strong>enable
</strong>(source_name)
350 </h3><div class=
"docstring">
351 <div class=
"discussion">
353 Enables a source via the Source Manager
362 </div><table class=
"source_code">
378 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
60</span>
380 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_enable'
>enable
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
381 <span class='id identifier rubyid_source_manager'
>source_manager
</span> <span class='op'
>=
</span> <span class='const'
>SourceManager
</span><span class='period'
>.
</span><span class='id identifier rubyid_new'
>new
</span>
382 <span class='kw'
>begin
</span>
383 <span class='id identifier rubyid_source_manager'
>source_manager
</span><span class='period'
>.
</span><span class='id identifier rubyid_enable'
>enable
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
384 <span class='kw'
>rescue
</span> <span class='const'
>Exceptions
</span><span class='op'
>::
</span><span class='const'
>UnknownSourceError
</span>
385 <span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
>There is no such Source
</span><span class='tstring_end'
>"</span></span>
386 <span class='kw'
>end
</span>
387 <span class='kw'
>end
</span></pre>
393 <div class=
"method_details ">
394 <h3 class=
"signature " id=
"lyrics-class_method">
396 + (
<tt>String
</tt>)
<strong>lyrics
</strong>
402 </h3><div class=
"docstring">
403 <div class=
"discussion">
405 Creates a new Lyricli instance and returns lyrics by going through the
414 <p class=
"tag_title">Returns:
</p>
420 <span class='type'
>(
<tt>String
</tt>)
</span>
425 <div class='inline'
><p>
434 </div><table class=
"source_code">
446 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
40</span>
448 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_lyrics'
>lyrics
</span>
449 <span class='ivar'
>@lyricli
</span> <span class='op'
>=
</span> <span class='const'
>Lyricli
</span><span class='period'
>.
</span><span class='id identifier rubyid_new'
>new
</span>
450 <span class='ivar'
>@lyricli
</span><span class='period'
>.
</span><span class='id identifier rubyid_get_lyrics'
>get_lyrics
</span>
451 <span class='kw'
>end
</span></pre>
457 <div class=
"method_details ">
458 <h3 class=
"signature " id=
"reset-class_method">
460 + (
<tt>Object
</tt>)
<strong>reset
</strong>(source_name)
466 </h3><div class=
"docstring">
467 <div class=
"discussion">
469 Resets all configuration for a source via the Source Manager
478 </div><table class=
"source_code">
494 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
80</span>
496 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_reset'
>reset
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
497 <span class='id identifier rubyid_source_manager'
>source_manager
</span> <span class='op'
>=
</span> <span class='const'
>SourceManager
</span><span class='period'
>.
</span><span class='id identifier rubyid_new'
>new
</span>
498 <span class='kw'
>begin
</span>
499 <span class='id identifier rubyid_source_manager'
>source_manager
</span><span class='period'
>.
</span><span class='id identifier rubyid_reset'
>reset
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_source_name'
>source_name
</span><span class='rparen'
>)
</span>
500 <span class='kw'
>rescue
</span> <span class='const'
>Exceptions
</span><span class='op'
>::
</span><span class='const'
>UnknownSourceError
</span>
501 <span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
>There is no such Source
</span><span class='tstring_end'
>"</span></span>
502 <span class='kw'
>end
</span>
503 <span class='kw'
>end
</span></pre>
509 <div class=
"method_details ">
510 <h3 class=
"signature " id=
"sources-class_method">
512 + (
<tt>String
</tt>)
<strong>sources
</strong>
518 </h3><div class=
"docstring">
519 <div class=
"discussion">
521 Returns a list of the available sources to enable or disable
529 <p class=
"tag_title">Returns:
</p>
535 <span class='type'
>(
<tt>String
</tt>)
</span>
540 <div class='inline'
><p>
541 the list of available sources. Enabled sources have a star appended.
549 </div><table class=
"source_code">
561 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
54</span>
563 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_sources'
>sources
</span>
564 <span class='id identifier rubyid_source_manager'
>source_manager
</span> <span class='op'
>=
</span> <span class='const'
>SourceManager
</span><span class='period'
>.
</span><span class='id identifier rubyid_new'
>new
</span>
565 <span class='id identifier rubyid_source_manager'
>source_manager
</span><span class='period'
>.
</span><span class='id identifier rubyid_available_sources'
>available_sources
</span><span class='lparen'
>(
</span><span class='kw'
>true
</span><span class='rparen'
>)
</span><span class='period'
>.
</span><span class='id identifier rubyid_join'
>join
</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>
566 <span class='kw'
>end
</span></pre>
572 <div class=
"method_details ">
573 <h3 class=
"signature " id=
"version-class_method">
575 + (
<tt>String
</tt>)
<strong>version
</strong>
581 </h3><div class=
"docstring">
582 <div class=
"discussion">
584 Returns the version of the library
592 <p class=
"tag_title">Returns:
</p>
598 <span class='type'
>(
<tt>String
</tt>)
</span>
603 <div class='inline'
><p>
612 </div><table class=
"source_code">
623 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli.rb', line
47</span>
625 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_version'
>version
</span>
626 <span class='const'
>Gem
</span><span class='period'
>.
</span><span class='id identifier rubyid_loaded_specs'
>loaded_specs
</span><span class='lbracket'
>[
</span><span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
>lyricli
</span><span class='tstring_end'
>"</span></span><span class='rbracket'
>]
</span><span class='period'
>.
</span><span class='id identifier rubyid_version'
>version
</span>
627 <span class='kw'
>end
</span></pre>
638 Generated on Sat Oct
6 03:
20:
24 2012 by
639 <a href=
"http://yardoc.org" title=
"Yay! A Ruby Documentation Tool" target=
"_parent">yard
</a>
640 0.8.2.1 (ruby-
1.9.2).