Class: Jabber::UserTune::Tune

Inherits:
XMPPElement show all
Defined in:
lib/xmpp4r/tune/tune.rb

Overview

The XMPP element, as defined in XEP-0118 User Tune

See http://www.xmpp.org/extensions/xep-0118.html - this element encapsulates metadata (artist, track etc) about a tune the user is currently playing. These are expressed as child elements such as , etc which are also managed by this class.</p> <p>If the element has no children then it indicates that the user has stopped playing a tune. Use the Tune#playing? method to discover this?</p> </div> </div> <div class="tags"> </div> <h2> Instance Method Summary <small><a href="#" class="summary_toggle">collapse</a></small> </h2> <ul class="summary"> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#artist-instance_method" title="#artist (instance method)">#<strong>artist</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get the artist for this tune.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(artist = nil, title = nil, length = nil, track = nil, source = nil, uri = nil, rating = nil) ⇒ Tune </a> </span> <span class="note title constructor">constructor</span> <span class="summary_desc"><div class='inline'><p>Construct a new <tune> element.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#length-instance_method" title="#length (instance method)">#<strong>length</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get the length of this tune, in seconds.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#playing%3F-instance_method" title="#playing? (instance method)">#<strong>playing?</strong> ⇒ Boolean </a> </span> <span class="summary_desc"><div class='inline'><p>Returns true if a tune is currently playing, otherwise false.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#rating-instance_method" title="#rating (instance method)">#<strong>rating</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get the rating for this track.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#source-instance_method" title="#source (instance method)">#<strong>source</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get the source of this tune, such as an album.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#title-instance_method" title="#title (instance method)">#<strong>title</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get the title of this tune.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#track-instance_method" title="#track (instance method)">#<strong>track</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get an identitier for this tune.</p></div></span> </li> <li class="public "> <span class="summary_signature"> <a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune#uri-instance_method" title="#uri (instance method)">#<strong>uri</strong> ⇒ Object </a> </span> <span class="summary_desc"><div class='inline'><p>Get a URI that represents this tune.</p></div></span> </li> </ul> <h3 class="inherited">Methods inherited from <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement" title="Jabber::XMPPElement (class)">XMPPElement</a></span></h3> <p class="inherited"><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#class_for_name_xmlns-class_method" title="Jabber::XMPPElement.class_for_name_xmlns (method)">class_for_name_xmlns</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#clone-instance_method" title="Jabber::XMPPElement#clone (method)">#clone</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#force_xmlns-class_method" title="Jabber::XMPPElement.force_xmlns (method)">force_xmlns</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#force_xmlns%3F-class_method" title="Jabber::XMPPElement.force_xmlns? (method)">force_xmlns?</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#import-class_method" title="Jabber::XMPPElement.import (method)">import</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#name_xmlns-class_method" title="Jabber::XMPPElement.name_xmlns (method)">name_xmlns</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#name_xmlns_for_class-class_method" title="Jabber::XMPPElement.name_xmlns_for_class (method)">name_xmlns_for_class</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#parent=-instance_method" title="Jabber::XMPPElement#parent= (method)">#parent=</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#set_xml_lang-instance_method" title="Jabber::XMPPElement#set_xml_lang (method)">#set_xml_lang</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#typed_add-instance_method" title="Jabber::XMPPElement#typed_add (method)">#typed_add</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#xml_lang-instance_method" title="Jabber::XMPPElement#xml_lang (method)">#xml_lang</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/XMPPElement#xml_lang=-instance_method" title="Jabber::XMPPElement#xml_lang= (method)">#xml_lang=</a></span></p> <h3 class="inherited">Methods inherited from <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">REXML::Element</a></span></h3> <p class="inherited"><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#==-instance_method" title="REXML::Element#== (method)">#==</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#delete_elements-instance_method" title="REXML::Element#delete_elements (method)">#delete_elements</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#each_elements-instance_method" title="REXML::Element#each_elements (method)">#each_elements</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#first_element-instance_method" title="REXML::Element#first_element (method)">#first_element</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#first_element_content-instance_method" title="REXML::Element#first_element_content (method)">#first_element_content</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#first_element_text-instance_method" title="REXML::Element#first_element_text (method)">#first_element_text</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#import-instance_method" title="REXML::Element#import (method)">#import</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#import-class_method" title="REXML::Element.import (method)">import</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#replace_element_content-instance_method" title="REXML::Element#replace_element_content (method)">#replace_element_content</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#replace_element_text-instance_method" title="REXML::Element#replace_element_text (method)">#replace_element_text</a></span>, <span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element#typed_add-instance_method" title="REXML::Element#typed_add (method)">#typed_add</a></span></p> <div id="constructor_details" class="method_details_list"> <h2>Constructor Details</h2> <div class="method_details first"> <h3 class="signature first" id="initialize-instance_method"> #<strong>initialize</strong>(artist = nil, title = nil, length = nil, track = nil, source = nil, uri = nil, rating = nil) ⇒ <tt><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/Jabber/UserTune/Tune" title="Jabber::UserTune::Tune (class)">Tune</a></span></tt> </h3><script> document.getElementById("initialize-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:initialize">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Construct a new <tune> element.</p> <p>Supply no arguments to make an empty element to indicate that tune playing has stopped.</p> <dl> <dt>artist</dt> <dd><p>[String] the artist or performer of the song or piece</p></dd> <dt>title</dt> <dd><p>[String] the title of the song or piece</p></dd> <dt>length</dt> <dd><p>[Fixnum] the duration of the song or piece in seconds</p></dd> <dt>track</dt> <dd><p>[String] a unique identifier for the tune; e.g., the track number within a collection or the specific URI for the object (e.g., a stream or audio file)</p></dd> <dt>source</dt> <dd><p>[String] the collection (e.g., album) or other source (e.g., a band website that hosts streams or audio files)</p></dd> <dt>uri</dt> <dd><p>[String] a URI or URL pointing to information about the song, collection, or artist</p></dd> <dt>rating</dt> <dd><p>[Numeric] a number indicating how much you like this song - will be clamped into an integer 0 <= x <= 10</p></dd> </dl> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 40</span> <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_artist'>artist</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_title'>title</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_length'>length</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_track'>track</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_uri'>uri</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='comma'>,</span> <span class='id identifier rubyid_rating'>rating</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span> <span class='kw'>super</span><span class='lparen'>(</span><span class='rparen'>)</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>artist</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_artist'>artist</span> <span class='kw'>if</span> <span class='id identifier rubyid_artist'>artist</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_title'>title</span> <span class='kw'>if</span> <span class='id identifier rubyid_title'>title</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>length</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_length'>length</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>if</span> <span class='id identifier rubyid_length'>length</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>track</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_track'>track</span> <span class='kw'>if</span> <span class='id identifier rubyid_track'>track</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>source</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span> <span class='kw'>if</span> <span class='id identifier rubyid_source'>source</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>uri</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_uri'>uri</span> <span class='kw'>if</span> <span class='id identifier rubyid_uri'>uri</span> <span class='kw'>if</span> <span class='id identifier rubyid_rating'>rating</span> <span class='kw'>and</span> <span class='id identifier rubyid_rating'>rating</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Numeric</span><span class='rparen'>)</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='id identifier rubyid_rating'>rating</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='int'>0</span> <span class='kw'>if</span> <span class='id identifier rubyid_r'>r</span> <span class='op'><</span> <span class='int'>0</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>=</span> <span class='int'>10</span> <span class='kw'>if</span> <span class='id identifier rubyid_r'>r</span> <span class='op'>></span> <span class='int'>10</span> <span class='id identifier rubyid_add_element'>add_element</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML" title="REXML (module)">REXML</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="/gems/gmcmillan-xmpp4r/0.6/REXML/Element" title="REXML::Element (class)">Element</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rating</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='op'>=</span> <span class='id identifier rubyid_r'>r</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='kw'>end</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> <div id="instance_method_details" class="method_details_list"> <h2>Instance Method Details</h2> <div class="method_details first"> <h3 class="signature first" id="artist-instance_method"> #<strong>artist</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("artist-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:artist">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get the artist for this tune.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 72 73 74</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 72</span> <span class='kw'>def</span> <span class='id identifier rubyid_artist'>artist</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>artist</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>artist</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="length-instance_method"> #<strong>length</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("length-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:length">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get the length of this tune, in seconds.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 84 85 86</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 84</span> <span class='kw'>def</span> <span class='id identifier rubyid_length'>length</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>length</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>length</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="playing?-instance_method"> #<strong>playing?</strong> ⇒ <tt>Boolean</tt> </h3><script> document.getElementById("playing?-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:playing%3F">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Returns true if a tune is currently playing, otherwise false.</p> </div> </div> <div class="tags"> <p class="tag_title">Returns:</p> <ul class="return"> <li> <span class='type'>(<tt>Boolean</tt>)</span> </li> </ul> </div><table class="source_code"> <tr> <td> <pre class="lines"> 66 67 68</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 66</span> <span class='kw'>def</span> <span class='id identifier rubyid_playing?'>playing?</span> <span class='lparen'>(</span><span class='id identifier rubyid_elements'>elements</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>></span> <span class='int'>0</span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="rating-instance_method"> #<strong>rating</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("rating-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:rating">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get the rating for this track</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 108 109 110</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 108</span> <span class='kw'>def</span> <span class='id identifier rubyid_rating'>rating</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rating</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>rating</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="source-instance_method"> #<strong>source</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("source-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:source">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get the source of this tune, such as an album.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 96 97 98</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 96</span> <span class='kw'>def</span> <span class='id identifier rubyid_source'>source</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>source</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>source</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="title-instance_method"> #<strong>title</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("title-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:title">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get the title of this tune.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 78 79 80</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 78</span> <span class='kw'>def</span> <span class='id identifier rubyid_title'>title</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>title</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="track-instance_method"> #<strong>track</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("track-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:track">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get an identitier for this tune.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 90 91 92</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 90</span> <span class='kw'>def</span> <span class='id identifier rubyid_track'>track</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>track</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>track</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> <div class="method_details "> <h3 class="signature " id="uri-instance_method"> #<strong>uri</strong> ⇒ <tt>Object</tt> </h3><script> document.getElementById("uri-instance_method").insertAdjacentHTML( "afterbegin", '<a class="permalink" href="/gems/gmcmillan-xmpp4r/0.6/Jabber%2FUserTune%2FTune:uri">permalink</a>' ); </script> <div class="docstring"> <div class="discussion"> <p>Get a URI that represents this tune.</p> </div> </div> <div class="tags"> </div><table class="source_code"> <tr> <td> <pre class="lines"> 102 103 104</pre> </td> <td> <pre class="code"><span class="info file"># File 'lib/xmpp4r/tune/tune.rb', line 102</span> <span class='kw'>def</span> <span class='id identifier rubyid_uri'>uri</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>uri</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_text'>text</span> <span class='kw'>if</span> <span class='id identifier rubyid_first_element'>first_element</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>uri</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span> <span class='kw'>end</span></pre> </td> </tr> </table> </div> </div> </div> <div id="footer"> Generated on Sun Sep 20 00:05:17 2026 by <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> 0.9.45 (ruby-4.0.7). </div> </div> </body> </html>