<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>
  Class: Hash
  
    &mdash; Documentation by YARD 0.9.28
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" />

  <link rel="stylesheet" href="css/common.css" type="text/css" />

<script type="text/javascript">
  pathId = "Hash";
  relpath = '';
</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 class="nav_wrap">
      <iframe id="nav" src="class_list.html?1"></iframe>
      <div id="resizer"></div>
    </div>

    <div id="main" tabindex="-1">
      <div id="header">
        <div id="menu">
  
    <a href="_index.html">Index (H)</a> &raquo;
    
    
    <span class="title">Hash</span>
  
</div>

        <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="class_list.html">

        <svg width="24" height="24">
          <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
          <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
        </svg>
    </a>
  
</div>
        <div class="clear"></div>
      </div>

      <div id="content"><h1>Class: Hash
  
  
  
</h1>
<div class="box_info">
  
  <dl>
    <dt>Inherits:</dt>
    <dd>
      <span class="inheritName"><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></span>
      
        <ul class="fullTree">
          <li><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></li>
          
            <li class="next">Hash</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
    </dd>
  </dl>
  

  
  
  
  
  

  

  
  <dl>
    <dt>Defined in:</dt>
    <dd>lib/doing/hash.rb</dd>
  </dl>
  
</div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>Hash helpers</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="#clone-instance_method" title="#clone (instance method)">#<strong>clone</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

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

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Freeze all values in a hash.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#deep_freeze!-instance_method" title="#deep_freeze! (instance method)">#<strong>deep_freeze!</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#deep_set-instance_method" title="#deep_set (instance method)">#<strong>deep_set</strong>(path, value)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Set a nested hash value using an array.</p>
</div></span>
  
</li>

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

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#deep_thaw!-instance_method" title="#deep_thaw! (instance method)">#<strong>deep_thaw!</strong>  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#delete_unless_key-instance_method" title="#delete_unless_key (instance method)">#<strong>delete_unless_key</strong>(key, to_delete)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Delete array of keys unless key exists.</p>
</div></span>
  
</li>

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

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Remove keys with empty values.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#rename_key-instance_method" title="#rename_key (instance method)">#<strong>rename_key</strong>(old_key, new_key, keep: false)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Rename a key, deleting old key.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#rename_keys-instance_method" title="#rename_keys (instance method)">#<strong>rename_keys</strong>(*pairs)  &#x21d2; Object </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Rename keys in batch.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stringify_keys-instance_method" title="#stringify_keys (instance method)">#<strong>stringify_keys</strong>  &#x21d2; Hash </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Turn all keys into string.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#stringify_values-instance_method" title="#stringify_values (instance method)">#<strong>stringify_values</strong>  &#x21d2; Hash </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Turn all non-numeric values into strings.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#symbolize_keys-instance_method" title="#symbolize_keys (instance method)">#<strong>symbolize_keys</strong>  &#x21d2; Hash </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Turn all keys into symbols.</p>
</div></span>
  
</li>

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

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#to_view-instance_method" title="#to_view (instance method)">#<strong>to_view</strong>  &#x21d2; Hash </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Convert an options hash to a view config.</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="clone-instance_method">
  
    #<strong>clone</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="deep_freeze-instance_method">
  
    #<strong>deep_freeze</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Freeze all values in a hash</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'></span>
      
      
      
        
        <div class='inline'><p>Hash with all values frozen</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="deep_freeze!-instance_method">
  
    #<strong>deep_freeze!</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="deep_set-instance_method">
  
    #<strong>deep_set</strong>(path, value)  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Set a nested hash value using an array</p>


  </div>
</div>
<div class="tags">
  
  <div class="examples">
    <p class="tag_title">Examples:</p>
    
      
      <pre class="example code"><code><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_deep_set'>deep_set</span><span class='lparen'>(</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>one</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>two</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>value</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
<span class='comment'># =&gt; { &#39;one&#39; =&gt; { &#39;two&#39; =&gt; &#39;value&#39; } }</span></code></pre>
    
  </div>
<p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>path</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>key path</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>value</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'><p>The value</p>
</div>
      
    </li>
  
</ul>


</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="deep_thaw-instance_method">
  
    #<strong>deep_thaw</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="deep_thaw!-instance_method">
  
    #<strong>deep_thaw!</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="delete_unless_key-instance_method">
  
    #<strong>delete_unless_key</strong>(key, to_delete)  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Delete array of keys unless key exists</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>key</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'><p>The key to verify</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>to_delete</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the keys to delete if key doesn&#39;t exist</p>
</div>
      
    </li>
  
</ul>


</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="remove_empty-instance_method">
  
    #<strong>remove_empty</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Remove keys with empty values</p>


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

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="rename_key-instance_method">
  
    #<strong>rename_key</strong>(old_key, new_key, keep: false)  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Rename a key, deleting old key</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>old_key</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'><p>The original key</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>new_key</span>
      
      
        <span class='type'></span>
      
      
      
        &mdash;
        <div class='inline'><p>The new key</p>
</div>
      
    </li>
  
    <li>
      
        <span class='name'>keep</span>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>false</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>if true, keep old key
in addition to new key</p>
</div>
      
    </li>
  
</ul>


</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="rename_keys-instance_method">
  
    #<strong>rename_keys</strong>(*pairs)  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Rename keys in batch</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>pairs</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="Array.html" title="Array (class)">Array</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>pairs of old and new keys</p>
</div>
      
    </li>
  
</ul>


</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="stringify_keys-instance_method">
  
    #<strong>stringify_keys</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Turn all keys into string</p>

<p>If the hash has both a string and a symbol for key,
keep the string value, discarding the symnbol value</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a copy of the hash where all its
keys are strings</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="stringify_values-instance_method">
  
    #<strong>stringify_values</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Turn all non-numeric values into strings</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a copy of the hash where all
non-numeric values are strings</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="symbolize_keys-instance_method">
  
    #<strong>symbolize_keys</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Turn all keys into symbols</p>

<p>If the hash has both a string and a symbol for a key,
keep the symbol value and discard the string value</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>a copy of the hash where all its
keys are symbols</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="tag_filter_to_options-instance_method">
  
    #<strong>tag_filter_to_options</strong>  &#x21d2; <tt><span class='object_link'><a href="Object.html" title="Object (class)">Object</a></span></tt> 
  

  

  
</h3>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="to_view-instance_method">
  
    #<strong>to_view</strong>  &#x21d2; <tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Convert an options hash to a view config</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Hash (class)">Hash</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>View representation of the object.</p>
</div>
      
    </li>
  
</ul>

</div>
</div>
    
  </div>

</div>

      <div id="footer">
  Generated on Fri Mar 10 15:19:58 2023 by
  <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.9.28 (ruby-3.0.1).
</div>

    </div>
  </body>
</html>