leopoldodonnell/tracks-attributes

View on GitHub
doc/TracksAttributes/TacksAttributesInternal.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: TracksAttributes::TacksAttributesInternal
  
    &mdash; Documentation by YARD 0.8.4.1
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '../';
  framesUrl = "../frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (T)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../TracksAttributes.html" title="TracksAttributes (module)">TracksAttributes</a></span></span>
     &raquo; 
    <span class="title">TacksAttributesInternal</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="../class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="../method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="../file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><h1>Module: TracksAttributes::TacksAttributesInternal
  
  
  
</h1>

<dl class="box">
  
  
    
      <dt class="r1">Extended by:</dt>
      <dd class="r1">ActiveSupport::Concern</dd>
      
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">lib/tracks_attributes.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Defined Under Namespace</h2>
<p class="children">
  
    
      <strong class="modules">Modules:</strong> <span class='object_link'><a href="TacksAttributesInternal/ClassMethods.html" title="TracksAttributes::TacksAttributesInternal::ClassMethods (module)">ClassMethods</a></span>
    
  
    
  
</p>







  
    <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="#accessors-instance_method" title="#accessors (instance method)">- (Object) <strong>accessors</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Return the array of accessor symbols for instances of this class.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#accessors_all-instance_method" title="#accessors_all (instance method)">- (Object) <strong>accessors_all</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Return a hash all of the accessor symbols and their values.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#from_json-instance_method" title="#from_json (instance method)">- (Object) <strong>from_json</strong>(json, include_root = false) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns an instance of TracksAttributes from a JSON string.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#from_xml-instance_method" title="#from_xml (instance method)">- (Object) <strong>from_xml</strong>(xml) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Returns an instance of TracksAttributes from an XML string.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_json-instance_method" title="#to_json (instance method)">- (Object) <strong>to_json</strong>(options = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Convert an TracksAttributes instance to JSON by delegating conversion to
Hash.to_json.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_xml-instance_method" title="#to_xml (instance method)">- (Object) <strong>to_xml</strong>(options = nil) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'>
<p>Convert an TracksAttributes instance to XML by delegating conversion to
Hash.to_xml.</p>
</div></span>
  
</li>

      
    </ul>
  


  

  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>

    
      <div class="method_details first">
  <h3 class="signature first" id="accessors-instance_method">
  
    - (<tt>Object</tt>) <strong>accessors</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Return the array of accessor symbols for instances of this class.</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


68
69
70</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/tracks_attributes.rb', line 68</span>

<span class='kw'>def</span> <span class='id identifier rubyid_accessors'>accessors</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_accessors'>accessors</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="accessors_all-instance_method">
  
    - (<tt>Object</tt>) <strong>accessors_all</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Return a hash all of the accessor symbols and their values</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


73
74
75</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/tracks_attributes.rb', line 73</span>

<span class='kw'>def</span> <span class='id identifier rubyid_accessors_all'>accessors_all</span>
  <span class='id identifier rubyid_attributes'>attributes</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span> <span class='const'>Hash</span><span class='lbracket'>[</span><span class='id identifier rubyid_accessors'>accessors</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_v'>v</span><span class='comma'>,</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_v'>v</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_respond_to?'>respond_to?</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_v'>v</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbrace'>}</span><span class='rbracket'>]</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="from_json-instance_method">
  
    - (<tt>Object</tt>) <strong>from_json</strong>(json, include_root = false) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns an instance of TracksAttributes from a JSON string</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


89
90
91
92
93</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/tracks_attributes.rb', line 89</span>

<span class='kw'>def</span> <span class='id identifier rubyid_from_json'>from_json</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='comma'>,</span> <span class='id identifier rubyid_include_root'>include_root</span><span class='op'>=</span><span class='kw'>false</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='const'>ActiveSupport</span><span class='op'>::</span><span class='const'>JSON</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_json'>json</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span> <span class='kw'>if</span> <span class='id identifier rubyid_include_root'>include_root</span>
  <span class='id identifier rubyid_assign_attrs_from_hash'>assign_attrs_from_hash</span> <span class='id identifier rubyid_hash'>hash</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="from_xml-instance_method">
  
    - (<tt>Object</tt>) <strong>from_xml</strong>(xml) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Returns an instance of TracksAttributes from an XML string</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


110
111
112
113</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/tracks_attributes.rb', line 110</span>

<span class='kw'>def</span> <span class='id identifier rubyid_from_xml'>from_xml</span><span class='lparen'>(</span><span class='id identifier rubyid_xml'>xml</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_hash'>hash</span> <span class='op'>=</span> <span class='const'>Hash</span><span class='period'>.</span><span class='id identifier rubyid_from_xml'>from_xml</span><span class='lparen'>(</span><span class='id identifier rubyid_xml'>xml</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_first'>first</span>
  <span class='id identifier rubyid_assign_attrs_from_hash'>assign_attrs_from_hash</span> <span class='id identifier rubyid_hash'>hash</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="to_json-instance_method">
  
    - (<tt>Object</tt>) <strong>to_json</strong>(options = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Convert an TracksAttributes instance to JSON by delegating conversion to
Hash.to_json</p>

<p>Without any options, the returned JSON string will include all of the
attributes.</p>

<p>The :only and :except options can be used to limit the attributes included,
and will  accept 1 or more hash keys to include/exclude.</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/tracks_attributes.rb', line 84</span>

<span class='kw'>def</span> <span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_accessors_all'>accessors_all</span><span class='period'>.</span><span class='id identifier rubyid_to_json'>to_json</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="to_xml-instance_method">
  
    - (<tt>Object</tt>) <strong>to_xml</strong>(options = nil) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    
<p>Convert an TracksAttributes instance to XML by delegating conversion to
Hash.to_xml</p>

<p>Without any options, the returned XML string will include all of the
attributes.</p>

<p>The :only and :except options can be used to limit the attributes included,
and will  accept 1 or more hash keys to include/exclude.</p>

<p>The :builder option uses key as the :root for the XML result</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


105
106
107</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/tracks_attributes.rb', line 105</span>

<span class='kw'>def</span> <span class='id identifier rubyid_to_xml'>to_xml</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_accessors_all'>accessors_all</span><span class='period'>.</span><span class='id identifier rubyid_to_xml'>to_xml</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span> <span class='op'>||</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Sat Feb 16 14:59:36 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.4.1 (ruby-1.9.3).
</div>

  </body>
</html>