<!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: Dynamoid::Document
  
    &mdash; Documentation by YARD 0.8.6.1
  
</title>

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

  <link rel="stylesheet" href="../css/common.css" type="text/css" 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 (D)</a> &raquo;
    <span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
     &raquo; 
    <span class="title">Document</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: Dynamoid::Document
  
  
  
</h1>

<dl class="box">
  
  
    
      <dt class="r1">Extended by:</dt>
      <dd class="r1">ActiveSupport::Concern</dd>
      
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2"><span class='object_link'><a href="Components.html" title="Dynamoid::Components (module)">Components</a></span></dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/dynamoid/document.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>This is the base module for all domain objects that need to be persisted to
the database as documents.</p>


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

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






  <h2>Instance Attribute Summary</h2>
  
  <h3 class="inherited">Attributes included from <span class='object_link'><a href="Persistence.html" title="Dynamoid::Persistence (module)">Persistence</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Persistence.html#new_record-instance_method" title="Dynamoid::Persistence#new_record (method)">#new_record</a></span></p>

  
  
  <h3 class="inherited">Attributes included from <span class='object_link'><a href="Fields.html" title="Dynamoid::Fields (module)">Fields</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Fields.html#attributes-instance_method" title="Dynamoid::Fields#attributes (method)">#attributes</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="#%3D%3D-instance_method" title="#== (instance method)">- (Object) <strong>==</strong>(other) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>An object is equal to another object if their ids are equal.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#eql%3F-instance_method" title="#eql? (instance method)">- (Boolean) <strong>eql?</strong>(other) </a>
    

    
  </span>
  
  
  
  
  
  
  

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

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

    
  </span>
  
  
  
  
  
  
  

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

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

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Return an object's hash key, regardless of what it might be called to the object.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#hash_key%3D-instance_method" title="#hash_key= (instance method)">- (Object) <strong>hash_key=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Assign an object's hash key, regardless of what it might be called to the object.</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Dynamoid::Document) <strong>initialize</strong>(attrs = {}) </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Initialize a new object.</p>
</div></span>
  
</li>

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

    
  </span>
  
  
  
  
  
  
  

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

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

    
  </span>
  
  
  
  
  
  
  

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

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#range_value%3D-instance_method" title="#range_value= (instance method)">- (Object) <strong>range_value=</strong>(value) </a>
    

    
  </span>
  
  
  
  
  
  
  

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

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#reload-instance_method" title="#reload (instance method)">- (Dynamoid::Document) <strong>reload</strong> </a>
    

    
  </span>
  
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Reload an object from the database -- if you suspect the object has changed in the datastore and you need those
changes to be reflected immediately, you would call this method.</p>
</div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Dirty.html" title="Dynamoid::Dirty (module)">Dirty</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Dirty.html#clear_changes-instance_method" title="Dynamoid::Dirty#clear_changes (method)">#clear_changes</a></span>, <span class='object_link'><a href="Dirty.html#save-instance_method" title="Dynamoid::Dirty#save (method)">#save</a></span>, <span class='object_link'><a href="Dirty.html#update%21-instance_method" title="Dynamoid::Dirty#update! (method)">#update!</a></span>, <span class='object_link'><a href="Dirty.html#write_attribute-instance_method" title="Dynamoid::Dirty#write_attribute (method)">#write_attribute</a></span></p>

  
  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="IdentityMap.html" title="Dynamoid::IdentityMap (module)">IdentityMap</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="IdentityMap.html#clear-class_method" title="Dynamoid::IdentityMap.clear (method)">clear</a></span>, <span class='object_link'><a href="IdentityMap.html#delete-instance_method" title="Dynamoid::IdentityMap#delete (method)">#delete</a></span>, <span class='object_link'><a href="IdentityMap.html#identity_map-instance_method" title="Dynamoid::IdentityMap#identity_map (method)">#identity_map</a></span>, <span class='object_link'><a href="IdentityMap.html#identity_map_key-instance_method" title="Dynamoid::IdentityMap#identity_map_key (method)">#identity_map_key</a></span>, <span class='object_link'><a href="IdentityMap.html#models-class_method" title="Dynamoid::IdentityMap.models (method)">models</a></span>, <span class='object_link'><a href="IdentityMap.html#save-instance_method" title="Dynamoid::IdentityMap#save (method)">#save</a></span></p>

  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Validations.html" title="Dynamoid::Validations (module)">Validations</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Validations.html#save-instance_method" title="Dynamoid::Validations#save (method)">#save</a></span>, <span class='object_link'><a href="Validations.html#save%21-instance_method" title="Dynamoid::Validations#save! (method)">#save!</a></span>, <span class='object_link'><a href="Validations.html#valid%3F-instance_method" title="Dynamoid::Validations#valid? (method)">#valid?</a></span></p>

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Persistence.html" title="Dynamoid::Persistence (module)">Persistence</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Persistence.html#delete-instance_method" title="Dynamoid::Persistence#delete (method)">#delete</a></span>, <span class='object_link'><a href="Persistence.html#destroy-instance_method" title="Dynamoid::Persistence#destroy (method)">#destroy</a></span>, <span class='object_link'><a href="Persistence.html#dump-instance_method" title="Dynamoid::Persistence#dump (method)">#dump</a></span>, <span class='object_link'><a href="Persistence.html#persisted%3F-instance_method" title="Dynamoid::Persistence#persisted? (method)">#persisted?</a></span>, <span class='object_link'><a href="Persistence.html#save-instance_method" title="Dynamoid::Persistence#save (method)">#save</a></span>, <span class='object_link'><a href="Persistence.html#touch-instance_method" title="Dynamoid::Persistence#touch (method)">#touch</a></span>, <span class='object_link'><a href="Persistence.html#update-instance_method" title="Dynamoid::Persistence#update (method)">#update</a></span>, <span class='object_link'><a href="Persistence.html#update%21-instance_method" title="Dynamoid::Persistence#update! (method)">#update!</a></span></p>

  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Indexes.html" title="Dynamoid::Indexes (module)">Indexes</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Indexes.html#delete_indexes-instance_method" title="Dynamoid::Indexes#delete_indexes (method)">#delete_indexes</a></span>, <span class='object_link'><a href="Indexes.html#save_indexes-instance_method" title="Dynamoid::Indexes#save_indexes (method)">#save_indexes</a></span></p>

  
  
  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="Fields.html" title="Dynamoid::Fields (module)">Fields</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="Fields.html#read_attribute-instance_method" title="Dynamoid::Fields#read_attribute (method)">#read_attribute</a></span>, <span class='object_link'><a href="Fields.html#update_attribute-instance_method" title="Dynamoid::Fields#update_attribute (method)">#update_attribute</a></span>, <span class='object_link'><a href="Fields.html#update_attributes-instance_method" title="Dynamoid::Fields#update_attributes (method)">#update_attributes</a></span>, <span class='object_link'><a href="Fields.html#write_attribute-instance_method" title="Dynamoid::Fields#write_attribute (method)">#write_attribute</a></span></p>

  
  
  
  
  
  
  
  

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

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

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>An object is equal to another object if their ids are equal.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Since:</p>
<ul class="since">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>0.2.0</p>
</div>
      
    </li>
  
</ul>

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


139
140
141
142
143
144
145
146</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 139</span>

<span class='kw'>def</span> <span class='op'>==</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
  <span class='kw'>if</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_identity_map_on?'>identity_map_on?</span>
    <span class='kw'>super</span>
  <span class='kw'>else</span>
    <span class='kw'>return</span> <span class='kw'>false</span> <span class='kw'>if</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
    <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Dynamoid</span><span class='op'>::</span><span class='const'>Document</span><span class='rparen'>)</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_hash_key'>hash_key</span> <span class='op'>&amp;&amp;</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_range_value'>range_value</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span><span class='period'>.</span><span class='id identifier rubyid_range_value'>range_value</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="eql?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>eql?</strong>(other) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    

  </div>
</div>
<div class="tags">
  
<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
    </li>
  
</ul>

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


148
149
150</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 148</span>

<span class='kw'>def</span> <span class='id identifier rubyid_eql?'>eql?</span><span class='lparen'>(</span><span class='id identifier rubyid_other'>other</span><span class='rparen'>)</span>
  <span class='kw'>self</span> <span class='op'>==</span> <span class='id identifier rubyid_other'>other</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="hash-instance_method">
  
    - (<tt>Object</tt>) <strong>hash</strong> 
  

  

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


152
153
154</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 152</span>

<span class='kw'>def</span> <span class='id identifier rubyid_hash'>hash</span>
  <span class='id identifier rubyid_hash_key'>hash_key</span><span class='period'>.</span><span class='id identifier rubyid_hash'>hash</span> <span class='op'>^</span> <span class='id identifier rubyid_range_value'>range_value</span><span class='period'>.</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="hash_key-instance_method">
  
    - (<tt>Object</tt>) <strong>hash_key</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Return an object's hash key, regardless of what it might be called to the object.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Since:</p>
<ul class="since">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>0.4.0</p>
</div>
      
    </li>
  
</ul>

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


172
173
174</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 172</span>

<span class='kw'>def</span> <span class='id identifier rubyid_hash_key'>hash_key</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</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_hash_key'>hash_key</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="hash_key=-instance_method">
  
    - (<tt>Object</tt>) <strong>hash_key=</strong>(value) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Assign an object's hash key, regardless of what it might be called to the object.</p>


  </div>
</div>
<div class="tags">
  
<p class="tag_title">Since:</p>
<ul class="since">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>0.4.0</p>
</div>
      
    </li>
  
</ul>

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


179
180
181</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 179</span>

<span class='kw'>def</span> <span class='id identifier rubyid_hash_key='>hash_key=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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_hash_key'>hash_key</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>initialize</strong>(attrs = {}) 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Initialize a new object.</p>


  </div>
</div>
<div class="tags">
  <p class="tag_title">Parameters:</p>
<ul class="param">
  
    <li>
      
        <span class='name'>attrs</span>
      
      
        <span class='type'>(<tt>Hash</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>{}</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>Attributes with which to create the object.</p>
</div>
      
    </li>
  
</ul>

<p class="tag_title">Returns:</p>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the new document</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Since:</p>
<ul class="since">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>0.2.0</p>
</div>
      
    </li>
  
</ul>

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


122
123
124
125
126
127
128
129
130</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 122</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
  <span class='id identifier rubyid_run_callbacks'>run_callbacks</span> <span class='symbol'>:initialize</span> <span class='kw'>do</span>
    <span class='ivar'>@new_record</span> <span class='op'>=</span> <span class='kw'>true</span>
    <span class='ivar'>@attributes</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
    <span class='ivar'>@associations</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>

    <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="load-instance_method">
  
    - (<tt>Object</tt>) <strong>load</strong>(attrs) 
  

  

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


132
133
134</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 132</span>

<span class='kw'>def</span> <span class='id identifier rubyid_load'>load</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</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_undump'>undump</span><span class='lparen'>(</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='rbrace'>}</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="range_value-instance_method">
  
    - (<tt>Object</tt>) <strong>range_value</strong> 
  

  

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


183
184
185
186
187</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 183</span>

<span class='kw'>def</span> <span class='id identifier rubyid_range_value'>range_value</span>
  <span class='kw'>if</span> <span class='id identifier rubyid_range_key'>range_key</span> <span class='op'>=</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_range_key'>range_key</span>
    <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_range_key'>range_key</span><span class='rparen'>)</span>
  <span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="range_value=-instance_method">
  
    - (<tt>Object</tt>) <strong>range_value=</strong>(value) 
  

  

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


189
190
191</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 189</span>

<span class='kw'>def</span> <span class='id identifier rubyid_range_value='>range_value=</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</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_range_key'>range_key</span><span class='rbrace'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <h3 class="signature " id="reload-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>) <strong>reload</strong> 
  

  

  
</h3><div class="docstring">
  <div class="discussion">
    <p>Reload an object from the database -- if you suspect the object has changed in the datastore and you need those
changes to be reflected immediately, you would call this method. This is a consistent read.</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="Dynamoid::Document (module)">Dynamoid::Document</a></span></tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>the document this method was called on</p>
</div>
      
    </li>
  
</ul>
<p class="tag_title">Since:</p>
<ul class="since">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>0.2.0</p>
</div>
      
    </li>
  
</ul>

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


162
163
164
165
166
167</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/dynamoid/document.rb', line 162</span>

<span class='kw'>def</span> <span class='id identifier rubyid_reload'>reload</span>
  <span class='id identifier rubyid_range_key_value'>range_key_value</span> <span class='op'>=</span> <span class='id identifier rubyid_range_value'>range_value</span> <span class='op'>?</span> <span class='id identifier rubyid_dumped_range_value'>dumped_range_value</span> <span class='op'>:</span> <span class='kw'>nil</span>
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span> <span class='op'>=</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_find'>find</span><span class='lparen'>(</span><span class='id identifier rubyid_hash_key'>hash_key</span><span class='comma'>,</span> <span class='symbol'>:range_key</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_range_key_value'>range_key_value</span><span class='comma'>,</span> <span class='symbol'>:consistent_read</span> <span class='op'>=&gt;</span> <span class='kw'>true</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span>
  <span class='ivar'>@associations</span><span class='period'>.</span><span class='id identifier rubyid_values'>values</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&amp;</span><span class='symbol'>:reset</span><span class='rparen'>)</span>
  <span class='kw'>self</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>

    <div id="footer">
  Generated on Thu Jun 27 21:59:11 2013 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.6.1 (ruby-1.9.3).
</div>

  </body>
</html>