html/classes/S33r/S3Object.html in s33r-0.3.1 vs html/classes/S33r/S3Object.html in s33r-0.4

- old
+ new

@@ -90,14 +90,14 @@ <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> - <a href="#M000057">delete</a>&nbsp;&nbsp; - <a href="#M000056">new</a>&nbsp;&nbsp; - <a href="#M000059">set_from_node</a>&nbsp;&nbsp; - <a href="#M000058">set_from_xml_string</a>&nbsp;&nbsp; + <a href="#M000088">delete</a>&nbsp;&nbsp; + <a href="#M000087">new</a>&nbsp;&nbsp; + <a href="#M000090">set_from_node</a>&nbsp;&nbsp; + <a href="#M000089">set_from_xml_string</a>&nbsp;&nbsp; </div> </div> </div> @@ -163,71 +163,71 @@ <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> - <div id="method-M000056" class="method-detail"> - <a name="M000056"></a> + <div id="method-M000087" class="method-detail"> + <a name="M000087"></a> <div class="method-heading"> - <a href="#M000056" class="method-signature"> + <a href="#M000087" class="method-signature"> <span class="method-name">new</span><span class="method-args">(node=nil, named_bucket=nil)</span> </a> </div> <div class="method-description"> <p> Create from a node. </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000056-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000056-source"> + onclick="toggleCode('M000087-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000087-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 105</span> -105: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">node</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">named_bucket</span>=<span class="ruby-keyword kw">nil</span>) -106: <span class="ruby-ivar">@named_bucket</span> = <span class="ruby-identifier">named_bucket</span> -107: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set_from_node</span>(<span class="ruby-identifier">node</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">nil?</span> -108: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 112</span> +112: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">node</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">named_bucket</span>=<span class="ruby-keyword kw">nil</span>) +113: <span class="ruby-ivar">@named_bucket</span> = <span class="ruby-identifier">named_bucket</span> +114: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">set_from_node</span>(<span class="ruby-identifier">node</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">node</span>.<span class="ruby-identifier">nil?</span> +115: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> <h3 class="section-bar">Public Instance methods</h3> - <div id="method-M000057" class="method-detail"> - <a name="M000057"></a> + <div id="method-M000088" class="method-detail"> + <a name="M000088"></a> <div class="method-heading"> - <a href="#M000057" class="method-signature"> + <a href="#M000088" class="method-signature"> <span class="method-name">delete</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Remove this object from associated <a href="NamedBucket.html">NamedBucket</a>. </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000057-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000057-source"> + onclick="toggleCode('M000088-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000088-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 111</span> -111: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span> -112: <span class="ruby-ivar">@named_bucket</span>.<span class="ruby-identifier">delete_key</span>(<span class="ruby-ivar">@key</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@named_bucket</span>.<span class="ruby-identifier">nil?</span> -113: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 118</span> +118: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span> +119: <span class="ruby-ivar">@named_bucket</span>.<span class="ruby-identifier">delete_key</span>(<span class="ruby-ivar">@key</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@named_bucket</span>.<span class="ruby-identifier">nil?</span> +120: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000059" class="method-detail"> - <a name="M000059"></a> + <div id="method-M000090" class="method-detail"> + <a name="M000090"></a> <div class="method-heading"> - <a href="#M000059" class="method-signature"> + <a href="#M000090" class="method-signature"> <span class="method-name">set_from_node</span><span class="method-args">(doc)</span> </a> </div> <div class="method-description"> @@ -238,36 +238,39 @@ <p> <tt>doc</tt>: <a href="../XML/Document.html">XML::Document</a> instance to parse to get properties for this object. </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000059-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000059-source"> + onclick="toggleCode('M000090-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000090-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 126</span> -126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from_node</span>(<span class="ruby-identifier">doc</span>) -127: <span class="ruby-ivar">@key</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'Key'</span>) -128: <span class="ruby-ivar">@last_modified</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'LastModified'</span>)) -129: <span class="ruby-ivar">@etag</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'ETag'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\&quot;&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>) -130: <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'Size'</span>).<span class="ruby-identifier">to_i</span> -131: <span class="ruby-ivar">@owner</span> = <span class="ruby-constant">S3User</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'Owner'</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">first</span>) -132: -133: <span class="ruby-comment cmt"># TODO: if setting from a full object listing (GET on a resource key),</span> -134: <span class="ruby-comment cmt"># do additional field setting here (e.g. x-amz-meta- headers)</span> -135: <span class="ruby-comment cmt"># and assign the response body to some data field; detect whether</span> -136: <span class="ruby-comment cmt"># these fields exist before attempting to set properties</span> -137: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 133</span> +133: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from_node</span>(<span class="ruby-identifier">doc</span>) +134: <span class="ruby-ivar">@key</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'Key'</span>) +135: <span class="ruby-ivar">@last_modified</span> = <span class="ruby-constant">DateTime</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'LastModified'</span>)) +136: <span class="ruby-ivar">@etag</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'ETag'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">&quot;\&quot;&quot;</span>, <span class="ruby-value str">&quot;&quot;</span>) +137: <span class="ruby-ivar">@size</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'Size'</span>).<span class="ruby-identifier">to_i</span> +138: +139: <span class="ruby-comment cmt"># Build representation of the owner.</span> +140: <span class="ruby-identifier">user_xml_doc</span> = <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">find</span>(<span class="ruby-value str">'Owner'</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">first</span> +141: <span class="ruby-ivar">@owner</span> = <span class="ruby-constant">S3ACL</span><span class="ruby-operator">::</span><span class="ruby-constant">CanonicalUser</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">user_xml_doc</span>) +142: +143: <span class="ruby-comment cmt"># TODO: if setting from a full object listing (GET on a resource key),</span> +144: <span class="ruby-comment cmt"># do additional field setting here (e.g. x-amz-meta- headers)</span> +145: <span class="ruby-comment cmt"># and assign the response body to some data field; detect whether</span> +146: <span class="ruby-comment cmt"># these fields exist before attempting to set properties</span> +147: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> - <div id="method-M000058" class="method-detail"> - <a name="M000058"></a> + <div id="method-M000089" class="method-detail"> + <a name="M000089"></a> <div class="method-heading"> - <a href="#M000058" class="method-signature"> + <a href="#M000089" class="method-signature"> <span class="method-name">set_from_xml_string</span><span class="method-args">(xml_str)</span> </a> </div> <div class="method-description"> @@ -278,16 +281,16 @@ <tt>xml_str</tt> should be a string representing a full <a href="../XML.html">XML</a> document, containing a &lt;Contents&gt; element as its root element. </p> <p><a class="source-toggle" href="#" - onclick="toggleCode('M000058-source');return false;">[Source]</a></p> - <div class="method-source-code" id="M000058-source"> + onclick="toggleCode('M000089-source');return false;">[Source]</a></p> + <div class="method-source-code" id="M000089-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 119</span> -119: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from_xml_string</span>(<span class="ruby-identifier">xml_str</span>) -120: <span class="ruby-identifier">set_from_node</span>(<span class="ruby-constant">XML</span>.<span class="ruby-identifier">get_xml_doc</span>(<span class="ruby-identifier">xml_str</span>)) -121: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/bucket_listing.rb, line 126</span> +126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_from_xml_string</span>(<span class="ruby-identifier">xml_str</span>) +127: <span class="ruby-identifier">set_from_node</span>(<span class="ruby-constant">XML</span>.<span class="ruby-identifier">get_xml_doc</span>(<span class="ruby-identifier">xml_str</span>)) +128: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> \ No newline at end of file