]> git.r.bdr.sh - rbdr/lyricli.rb/blobdiff - doc/Lyricli/Configuration.html
Adds some documentation
[rbdr/lyricli.rb] / doc / Lyricli / Configuration.html
index 7ca3571964ee2d762e74b5e256e57fde8fe03d11..77112a3280b9e5a1cf64137ff093aec492949dcd 100644 (file)
@@ -6,7 +6,7 @@
 <title>
   Class: Lyricli::Configuration
   
 <title>
   Class: Lyricli::Configuration
   
-    &mdash; Documentation by YARD 0.8.1
+    &mdash; Documentation by YARD 0.8.2.1
   
 </title>
 
   
 </title>
 
   
 
   
   
 
   
+    <span class="summary_desc"><div class='inline'></div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#delete-instance_method" title="#delete (instance method)">- (Object) <strong>delete</strong>(key) </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
     <span class="summary_desc"><div class='inline'></div></span>
   
 </li>
     <span class="summary_desc"><div class='inline'></div></span>
   
 </li>
@@ -225,6 +247,53 @@ A new instance of Configuration.
 </p>
 </div></span>
   
 </p>
 </div></span>
   
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#load_config-instance_method" title="#load_config (instance method)">- (Object) <strong>load_config</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'><p>
+TODO: Apart from this, load a default yml that will be used for this.
+</p>
+</div></span>
+  
+</li>
+
+      
+        <li class="public ">
+  <span class="summary_signature">
+    
+      <a href="#save_config-instance_method" title="#save_config (instance method)">- (Object) <strong>save_config</strong> </a>
+    
+
+    
+  </span>
+  
+  
+  
+  
+  
+  
+  
+
+  
+    <span class="summary_desc"><div class='inline'></div></span>
+  
 </li>
 
       
 </li>
 
       
@@ -264,7 +333,8 @@ A new instance of Configuration
 4
 5
 6
 4
 5
 6
-7</pre>
+7
+8</pre>
     </td>
     <td>
       <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 4</span>
     </td>
     <td>
       <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 4</span>
@@ -272,6 +342,7 @@ A new instance of Configuration
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
   <span class='ivar'>@config_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~/.lyricli.conf</span><span class='tstring_end'>&quot;</span></span>
   <span class='ivar'>@defaults_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>defaults.json</span><span class='tstring_end'>&quot;</span></span>
 <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
   <span class='ivar'>@config_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>~/.lyricli.conf</span><span class='tstring_end'>&quot;</span></span>
   <span class='ivar'>@defaults_path</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>defaults.json</span><span class='tstring_end'>&quot;</span></span>
+  <span class='ivar'>@config</span> <span class='op'>=</span> <span class='kw'>nil</span>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
 <span class='kw'>end</span></pre>
     </td>
   </tr>
@@ -300,12 +371,12 @@ A new instance of Configuration
       <pre class="lines">
 
 
       <pre class="lines">
 
 
-11
 12
 12
-13</pre>
+13
+14</pre>
     </td>
     <td>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 11</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 12</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
   <span class='cvar'>@@instance</span>
 
 <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_instance'>instance</span>
   <span class='cvar'>@@instance</span>
@@ -336,13 +407,13 @@ A new instance of Configuration
       <pre class="lines">
 
 
       <pre class="lines">
 
 
-15
 16
 17
 16
 17
-18</pre>
+18
+19</pre>
     </td>
     <td>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 15</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 16</span>
 
 <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
 
 <span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
@@ -368,14 +439,14 @@ A new instance of Configuration
       <pre class="lines">
 
 
       <pre class="lines">
 
 
-20
 21
 22
 23
 21
 22
 23
-24</pre>
+24
+25</pre>
     </td>
     <td>
     </td>
     <td>
-      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 20</span>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 21</span>
 
 <span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
 
 <span class='kw'>def</span> <span class='op'>[]=</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
   <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
@@ -385,6 +456,133 @@ A new instance of Configuration
     </td>
   </tr>
 </table>
     </td>
   </tr>
 </table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="delete-instance_method">
+  
+    - (<tt>Object</tt>) <strong>delete</strong>(key) 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+27
+28
+29
+30
+31</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 27</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_load_config'>load_config</span> <span class='kw'>unless</span> <span class='ivar'>@config</span>
+  <span class='ivar'>@config</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_save_config'>save_config</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="load_config-instance_method">
+  
+    - (<tt>Object</tt>) <strong>load_config</strong> 
+  
+
+  
+
+  
+</h3><div class="docstring">
+  <div class="discussion">
+    <p>
+TODO: Apart from this, load a default yml that will be used for this. And
+just extend everything from the user&#8217;s config.
+</p>
+
+
+  </div>
+</div>
+<div class="tags">
+  
+
+</div><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 37</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_load_config'>load_config</span>
+  <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_expand_path'>expand_path</span><span class='lparen'>(</span><span class='ivar'>@config_path</span><span class='rparen'>)</span>
+
+  <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_exists?'>exists?</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span>
+    <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>r</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+    <span class='ivar'>@config</span> <span class='op'>=</span> <span class='const'>MultiJson</span><span class='period'>.</span><span class='id identifier rubyid_decode'>decode</span><span class='lparen'>(</span><span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_read'>read</span><span class='rparen'>)</span>
+  <span class='kw'>else</span>
+    <span class='id identifier rubyid_load_default_config'>load_default_config</span>
+  <span class='kw'>end</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
+</div>
+    
+      <div class="method_details ">
+  <h3 class="signature " id="save_config-instance_method">
+  
+    - (<tt>Object</tt>) <strong>save_config</strong> 
+  
+
+  
+
+  
+</h3><table class="source_code">
+  <tr>
+    <td>
+      <pre class="lines">
+
+
+48
+49
+50
+51
+52
+53</pre>
+    </td>
+    <td>
+      <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 48</span>
+
+<span class='kw'>def</span> <span class='id identifier rubyid_save_config'>save_config</span>
+  <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_expand_path'>expand_path</span><span class='lparen'>(</span><span class='ivar'>@config_path</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>w</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_print'>print</span><span class='lparen'>(</span><span class='const'>MultiJson</span><span class='period'>.</span><span class='id identifier rubyid_encode'>encode</span><span class='lparen'>(</span><span class='ivar'>@config</span><span class='rparen'>)</span><span class='rparen'>)</span>
+  <span class='id identifier rubyid_file'>file</span><span class='period'>.</span><span class='id identifier rubyid_close'>close</span>
+<span class='kw'>end</span></pre>
+    </td>
+  </tr>
+</table>
 </div>
     
   </div>
 </div>
     
   </div>
@@ -392,9 +590,9 @@ A new instance of Configuration
 </div>
 
     <div id="footer">
 </div>
 
     <div id="footer">
-  Generated on Fri Oct  5 22:31:14 2012 by
+  Generated on Sat Oct  6 02:05:51 2012 by
   <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
   <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>
 </div>
 
   </body>