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::Sources::Itunes
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 (I)
</a> »
35 <span class='title'
><span class='object_link'
><a href=
"../../Lyricli.html" title=
"Lyricli (module)">Lyricli
</a></span></span> » <span class='title'
><span class='object_link'
><a href=
"../Sources.html" title=
"Lyricli::Sources (module)">Sources
</a></span></span>
37 <span class=
"title">Itunes
</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::Sources::Itunes
74 <dt class=
"r1">Inherits:
</dt>
76 <span class=
"inheritName">Object
</span>
81 <li class=
"next">Lyricli::Sources::Itunes
</li>
84 <a href=
"#" class=
"inheritanceTree">show all
</a>
96 <dt class=
"r2 last">Defined in:
</dt>
97 <dd class=
"r2 last">lib/lyricli/sources/itunes.rb
</dd>
100 <div class=
"clear"></div>
102 <h2>Overview
</h2><div class=
"docstring">
103 <div class=
"discussion">
105 The source for iTunes
118 <h2>Class Attribute Summary
<small>(
<a href=
"#" class=
"summary_toggle">collapse
</a>)
</small></h2>
122 <span class=
"summary_signature">
124 <a href=
"#name-class_method" title=
"name (class method)">+ (Object)
<strong>name
</strong> </a>
141 <span class=
"summary_desc"><div class='inline'
><p>
142 Returns the value of attribute name.
157 <small>(
<a href=
"#" class=
"summary_toggle">collapse
</a>)
</small>
163 <span class=
"summary_signature">
165 <a href=
"#enable-class_method" title=
"enable (class method)">+ (Object)
<strong>enable
</strong> </a>
179 <span class=
"summary_desc"><div class='inline'
><p>
180 The enable method should run all of the tasks needed to validate the
189 <span class=
"summary_signature">
191 <a href=
"#reset-class_method" title=
"reset (class method)">+ (Object)
<strong>reset
</strong> </a>
205 <span class=
"summary_desc"><div class='inline'
><p>
206 The reset method resets any configurations it may have.
216 Instance Method Summary
217 <small>(
<a href=
"#" class=
"summary_toggle">collapse
</a>)
</small>
223 <span class=
"summary_signature">
225 <a href=
"#current_track-instance_method" title=
"#current_track (instance method)">- (Hash)
<strong>current_track
</strong> </a>
239 <span class=
"summary_desc"><div class='inline'
><p>
240 The current_track method should return the name of the current artist and
249 <span class=
"summary_signature">
251 <a href=
"#initialize-instance_method" title=
"#initialize (instance method)">- (Itunes)
<strong>initialize
</strong> </a>
258 <span class=
"note title constructor">constructor
</span>
267 <span class=
"summary_desc"><div class='inline'
><p>
268 Instantiates everything it needs to run.
278 <div id=
"constructor_details" class=
"method_details_list">
279 <h2>Constructor Details
</h2>
281 <div class=
"method_details first">
282 <h3 class=
"signature first" id=
"initialize-instance_method">
284 - (
<tt><span class='object_link'
><a href=
"" title=
"Lyricli::Sources::Itunes (class)">Itunes
</a></span></tt>)
<strong>initialize
</strong>
290 </h3><div class=
"docstring">
291 <div class=
"discussion">
293 Instantiates everything it needs to run.
302 </div><table class=
"source_code">
314 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/sources/itunes.rb', line
19</span>
316 <span class='kw'
>def
</span> <span class='id identifier rubyid_initialize'
>initialize
</span>
317 <span class='ivar'
>@config
</span> <span class='op'
>=
</span> <span class='const'
>Configuration
</span><span class='period'
>.
</span><span class='id identifier rubyid_instance'
>instance
</span>
318 <span class='ivar'
>@script
</span> <span class='op'
>=
</span> <span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
>current_song.scpt
</span><span class='tstring_end'
>"</span></span>
319 <span class='kw'
>end
</span></pre>
327 <div id=
"class_attr_details" class=
"attr_details">
328 <h2>Class Attribute Details
</h2>
331 <span id=
"name=-class_method"></span>
332 <div class=
"method_details first">
333 <h3 class=
"signature first" id=
"name-class_method">
335 + (
<tt>Object
</tt>)
<strong>name
</strong>
341 </h3><div class=
"docstring">
342 <div class=
"discussion">
344 Returns the value of attribute name
353 </div><table class=
"source_code">
364 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/sources/itunes.rb', line
7</span>
366 <span class='kw'
>def
</span> <span class='id identifier rubyid_name'
>name
</span>
367 <span class='ivar'
>@name
</span>
368 <span class='kw'
>end
</span></pre>
377 <div id=
"class_method_details" class=
"method_details_list">
378 <h2>Class Method Details
</h2>
381 <div class=
"method_details first">
382 <h3 class=
"signature first" id=
"enable-class_method">
384 + (
<tt>Object
</tt>)
<strong>enable
</strong>
390 </h3><div class=
"docstring">
391 <div class=
"discussion">
393 The enable method should run all of the tasks needed to validate the
394 source. In the case of Rdio it has to authenticate with OAuth.
403 </div><table class=
"source_code">
414 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/sources/itunes.rb', line
14</span>
416 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_enable'
>enable
</span>
417 <span class='comment'
># Nothing to do
418 </span><span class='kw'
>end
</span></pre>
424 <div class=
"method_details ">
425 <h3 class=
"signature " id=
"reset-class_method">
427 + (
<tt>Object
</tt>)
<strong>reset
</strong>
433 </h3><div class=
"docstring">
434 <div class=
"discussion">
436 The reset method resets any configurations it may have
445 </div><table class=
"source_code">
456 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/sources/itunes.rb', line
36</span>
458 <span class='kw'
>def
</span> <span class='kw'
>self
</span><span class='period'
>.
</span><span class='id identifier rubyid_reset'
>reset
</span>
459 <span class='comment'
># Nothing to do
460 </span><span class='kw'
>end
</span></pre>
468 <div id=
"instance_method_details" class=
"method_details_list">
469 <h2>Instance Method Details
</h2>
472 <div class=
"method_details first">
473 <h3 class=
"signature first" id=
"current_track-instance_method">
475 - (
<tt>Hash
</tt>)
<strong>current_track
</strong>
481 </h3><div class=
"docstring">
482 <div class=
"discussion">
484 The current_track method should return the name of the current artist and
493 <p class=
"tag_title">Returns:
</p>
499 <span class='type'
>(
<tt>Hash
</tt>)
</span>
504 <div class='inline'
><p>
505 A hash containing the current `:song` and `:artist`.
513 </div><table class=
"source_code">
528 <pre class=
"code"><span class=
"info file"># File 'lib/lyricli/sources/itunes.rb', line
27</span>
530 <span class='kw'
>def
</span> <span class='id identifier rubyid_current_track'
>current_track
</span>
531 <span class='id identifier rubyid_path_root'
>path_root
</span> <span class='op'
>=
</span> <span class='const'
>File
</span><span class='period'
>.
</span><span class='id identifier rubyid_expand_path'
>expand_path
</span><span class='lparen'
>(
</span><span class='const'
>File
</span><span class='period'
>.
</span><span class='id identifier rubyid_dirname'
>dirname
</span><span class='lparen'
>(
</span><span class='kw'
>__FILE__
</span><span class='rparen'
>)
</span><span class='rparen'
>)
</span>
532 <span class='id identifier rubyid_path'
>path
</span> <span class='op'
>=
</span> <span class='const'
>File
</span><span class='period'
>.
</span><span class='id identifier rubyid_join'
>join
</span><span class='lparen'
>(
</span><span class='id identifier rubyid_path_root'
>path_root
</span><span class='comma'
>,
</span> <span class='ivar'
>@script
</span><span class='rparen'
>)
</span>
533 <span class='id identifier rubyid_current'
>current
</span> <span class='op'
>=
</span> <span class='backtick'
>`
</span><span class='tstring_content'
>osascript
</span><span class='embexpr_beg'
>#{
</span><span class='id identifier rubyid_path'
>path
</span><span class='rbrace'
>}
</span><span class='tstring_end'
>`
</span></span>
534 <span class='id identifier rubyid_current'
>current
</span> <span class='op'
>=
</span> <span class='id identifier rubyid_current'
>current
</span><span class='period'
>.
</span><span class='id identifier rubyid_split'
>split
</span><span class='lparen'
>(
</span><span class='tstring'
><span class='tstring_beg'
>"</span><span class='tstring_content'
><-SEP-
></span><span class='tstring_end'
>"</span></span><span class='rparen'
>)
</span>
535 <span class='lbrace'
>{
</span><span class='label'
>artist:
</span> <span class='id identifier rubyid_current'
>current
</span><span class='lbracket'
>[
</span><span class='int'
>0</span><span class='rbracket'
>]
</span><span class='comma'
>,
</span> <span class='label'
>song:
</span> <span class='id identifier rubyid_current'
>current
</span><span class='lbracket'
>[
</span><span class='int'
>1</span><span class='rbracket'
>]
</span><span class='rbrace'
>}
</span>
536 <span class='kw'
>end
</span></pre>
547 Generated on Sat Oct
6 03:
20:
24 2012 by
548 <a href=
"http://yardoc.org" title=
"Yay! A Ruby Documentation Tool" target=
"_parent">yard
</a>
549 0.8.2.1 (ruby-
1.9.2).