+</div>
+
+ <div class="method_details ">
+ <h3 class="signature " id="delete-instance_method">
+
+ - (<tt>Object</tt>) <strong>delete</strong>(key)
+
+
+
+
+
+</h3><div class="docstring">
+ <div class="discussion">
+ <p>
+Deletes a key from the configuration, loads config if needed and saves it
+after deleting.
+</p>
+
+
+ </div>
+</div>
+<div class="tags">
+ <p class="tag_title">Parameters:</p>
+<ul class="param">
+
+ <li>
+
+ <span class='name'>key</span>
+
+
+ <span class='type'>(<tt>String</tt>)</span>
+
+
+
+ —
+ <div class='inline'><p>
+the key to delete
+</p>
+</div>
+
+ </li>
+
+</ul>
+
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+46
+47
+48
+49
+50</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 46</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>
+Loads the configuration from the user file, attempts to create it from
+defaults if it’s not present. sets the `@config` instance variable.
+</p>
+
+
+ </div>
+</div>
+<div class="tags">
+
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 56</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'>"</span><span class='tstring_content'>r</span><span class='tstring_end'>"</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><div class="docstring">
+ <div class="discussion">
+ <p>
+Serializes the `@config` Hash to JSON and saves it to a file.
+</p>
+
+
+ </div>
+</div>
+<div class="tags">
+
+
+</div><table class="source_code">
+ <tr>
+ <td>
+ <pre class="lines">
+
+
+68
+69
+70
+71
+72
+73</pre>
+ </td>
+ <td>
+ <pre class="code"><span class="info file"># File 'lib/lyricli/configuration.rb', line 68</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'>"</span><span class='tstring_content'>w</span><span class='tstring_end'>"</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>