]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - doc/Lyricli/Util.html
Quick Update to the readme
[rbdr/lyricli.rb] / doc / Lyricli / Util.html
index 71499bfca043173dd945285c6b81a2158a71aa8d..610ec2cce61e531b29dea880a797e19aebaa6fe6 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Module: Lyricli::Util
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
 </dl>
 <div class="clear"></div>
 
+<h2>Overview</h2><div class="docstring">
+  <div class="discussion">
+    <p>
+This module contains several utility functions.
+</p>
 
 
+  </div>
+</div>
+<div class="tags">
+  
+
+</div>
+
 
 
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#camelize-instance_method" title="#camelize (instance method)">- (Object) <strong>camelize</strong>(str) </a>
+      <a href="#camelize-instance_method" title="#camelize (instance method)">- (String) <strong>camelize</strong>(str) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Transforms a string from snake_case to UpperCamelCase.
+</p>
+</div></span>
   
 </li>
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#parse_class-instance_method" title="#parse_class (instance method)">- (Object) <strong>parse_class</strong>(class_name) </a>
+      <a href="#parse_class-instance_method" title="#parse_class (instance method)">- (Class<sup>?</sup>) <strong>parse_class</strong>(class_name) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Takes a class name in snake_case and attempts to find the corresponding
+class from the sources.
+</p>
+</div></span>
   
 </li>
 
         <li class="public ">
   <span class="summary_signature">
     
-      <a href="#sanitize_param-instance_method" title="#sanitize_param (instance method)">- (Object) <strong>sanitize_param</strong>(p) </a>
+      <a href="#sanitize_param-instance_method" title="#sanitize_param (instance method)">- (String) <strong>sanitize_param</strong>(p) </a>
     
 
     
   
 
   
-    <span class="summary_desc"><div class='inline'></div></span>
+    <span class="summary_desc"><div class='inline'><p>
+Simply escapes a param and substitutes spaces and escaped plus signs for
+plus signs.
+</p>
+</div></span>
   
 </li>
 
       <div class="method_details first">
   <h3 class="signature first" id="camelize-instance_method">
   
-    - (<tt>Object</tt>) <strong>camelize</strong>(str) 
+    - (<tt>String</tt>) <strong>camelize</strong>(str) 
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Transforms a string from snake_case to UpperCamelCase
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
+  
+    <li>
+      
+        <span class='name'>str</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the string that will be Camelized
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the Camelized string.
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-3
-4
-5</pre>
+9
+10
+11</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 3</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 9</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_camelize'>camelize</span><span class='lparen'>(</span><span class='id identifier rubyid_str'>str</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_str'>str</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'>_</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_w'>w</span><span class='op'>|</span> <span class='id identifier rubyid_w'>w</span><span class='period'>.</span><span class='id identifier rubyid_capitalize'>capitalize</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
       <div class="method_details ">
   <h3 class="signature " id="parse_class-instance_method">
   
-    - (<tt>Object</tt>) <strong>parse_class</strong>(class_name) 
+    - (<tt>Class</tt><sup>?</sup>) <strong>parse_class</strong>(class_name) 
   
 
   
 
   
-</h3><table class="source_code">
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Takes a class name in snake_case and attempts to find the corresponding
+class from the sources.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
+  
+    <li>
+      
+        <span class='name'>class_name</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the snake_case name of the class to search for.
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>Class</tt>, <tt>nil</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the found class or nil
+</p>
+</div>
+      
+    </li>
+  
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-7
-8
-9
-10
-11
-12
-13
-14</pre>
+18
+19
+20
+21
+22
+23
+24
+25</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 7</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 18</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_parse_class'>parse_class</span><span class='lparen'>(</span><span class='id identifier rubyid_class_name'>class_name</span><span class='rparen'>)</span>
   <span class='kw'>begin</span>
       <div class="method_details ">
   <h3 class="signature " id="sanitize_param-instance_method">
   
-    - (<tt>Object</tt>) <strong>sanitize_param</strong>(p) 
+    - (<tt>String</tt>) <strong>sanitize_param</strong>(p) 
+  
+
+  
+
   
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+Simply escapes a param and substitutes spaces and escaped plus signs for
+plus signs.
+</p>
 
+
+  </div>
+</div>
+<div class="tags">
+  <p class="tag_title">Parameters:</p>
+<ul class="param">
   
+    <li>
+      
+        <span class='name'>p</span>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the parameter to be sanitized
+</p>
+</div>
+      
+    </li>
+  
+</ul>
 
+<p class="tag_title">Returns:</p>
+<ul class="return">
+  
+    <li>
+      
+      
+        <span class='type'>(<tt>String</tt>)</span>
+      
+      
+      
+        &mdash;
+        <div class='inline'><p>
+the sanitized parameter
+</p>
+</div>
+      
+    </li>
   
-</h3><table class="source_code">
+</ul>
+
+</div><table class="source_code">
   <tr>
     <td>
       <pre class="lines">
 
 
-16
-17
-18</pre>
+32
+33
+34</pre>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 16</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/util.rb', line 32</span>
 
 <span class='kw'>def</span> <span class='id identifier rubyid_sanitize_param'>sanitize_param</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='rparen'>)</span>
   <span class='const'>URI</span><span class='period'>.</span><span class='id identifier rubyid_encode_www_form_component'>encode_www_form_component</span><span class='lparen'>(</span><span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'> </span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%2B</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>+</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 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.1 (ruby-1.9.2).
+  0.8.2.1 (ruby-1.9.2).
 </div>
 
   </body>