html/classes/S33r/S3ACL/Grantee.html in s33r-0.4.1 vs html/classes/S33r/S3ACL/Grantee.html in s33r-0.4.2

- old
+ new

@@ -141,29 +141,29 @@ <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000076-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000076-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 264</span> -264: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">grantee_xml</span>) -265: <span class="ruby-identifier">grantee_type</span> = <span class="ruby-identifier">grantee_xml</span>[<span class="ruby-value str">'type'</span>] -266: -267: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">grantee_type</span> -268: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:amazon_customer</span>] -269: <span class="ruby-constant">AmazonCustomer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">grantee_xml</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'EmailAddress'</span>)) -270: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:canonical_user</span>] -271: <span class="ruby-constant">CanonicalUser</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">grantee_xml</span>) -272: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:group</span>] -273: <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">grantee_xml</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'URI'</span>) -274: <span class="ruby-comment cmt"># last part of the path is the group type</span> -275: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{GROUP_ACL_URI_BASE}/</span>, <span class="ruby-value str">''</span>) -276: -277: <span class="ruby-identifier">group_type</span> = <span class="ruby-identifier">:all_users</span> -278: <span class="ruby-constant">S3_GROUP_TYPES</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">group_type</span> = <span class="ruby-identifier">k</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">path</span> } -279: <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">group_type</span>) -280: <span class="ruby-keyword kw">end</span> -281: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 265</span> +265: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">grantee_xml</span>) +266: <span class="ruby-identifier">grantee_type</span> = <span class="ruby-identifier">grantee_xml</span>[<span class="ruby-value str">'type'</span>] +267: +268: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">grantee_type</span> +269: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:amazon_customer</span>] +270: <span class="ruby-constant">AmazonCustomer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">grantee_xml</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'EmailAddress'</span>)) +271: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:canonical_user</span>] +272: <span class="ruby-constant">CanonicalUser</span>.<span class="ruby-identifier">from_xml</span>(<span class="ruby-identifier">grantee_xml</span>) +273: <span class="ruby-keyword kw">when</span> <span class="ruby-constant">GRANTEE_TYPES</span>[<span class="ruby-identifier">:group</span>] +274: <span class="ruby-identifier">uri</span> = <span class="ruby-identifier">grantee_xml</span>.<span class="ruby-identifier">xget</span>(<span class="ruby-value str">'URI'</span>) +275: <span class="ruby-comment cmt"># last part of the path is the group type</span> +276: <span class="ruby-identifier">path</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-node">/#{GROUP_ACL_URI_BASE}/</span>, <span class="ruby-value str">''</span>) +277: +278: <span class="ruby-identifier">group_type</span> = <span class="ruby-identifier">:all_users</span> +279: <span class="ruby-constant">S3_GROUP_TYPES</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">group_type</span> = <span class="ruby-identifier">k</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">v</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">path</span> } +280: <span class="ruby-constant">Group</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">group_type</span>) +281: <span class="ruby-keyword kw">end</span> +282: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> @@ -181,23 +181,23 @@ <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000074-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000074-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 247</span> -247: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">obj</span>) -248: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Grantee</span>) -249: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -250: <span class="ruby-keyword kw">end</span> -251: <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span> -252: <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">var</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^@/</span>, <span class="ruby-value str">''</span>) -253: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_name</span>) <span class="ruby-operator">!=</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_name</span>) -254: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> -255: <span class="ruby-keyword kw">end</span> -256: <span class="ruby-keyword kw">end</span> -257: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> -258: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 248</span> +248: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">obj</span>) +249: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">obj</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Grantee</span>) +250: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +251: <span class="ruby-keyword kw">end</span> +252: <span class="ruby-identifier">instance_variables</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span><span class="ruby-operator">|</span> +253: <span class="ruby-identifier">method_name</span> = <span class="ruby-identifier">var</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^@/</span>, <span class="ruby-value str">''</span>) +254: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_name</span>) <span class="ruby-operator">!=</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">method_name</span>) +255: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> +256: <span class="ruby-keyword kw">end</span> +257: <span class="ruby-keyword kw">end</span> +258: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> +259: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> @@ -213,13 +213,13 @@ <div class="method-description"> <p><a class="source-toggle" href="#" onclick="toggleCode('M000075-source');return false;">[Source]</a></p> <div class="method-source-code" id="M000075-source"> <pre> - <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 260</span> -260: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) -261: <span class="ruby-keyword kw">nil</span> -262: <span class="ruby-keyword kw">end</span> + <span class="ruby-comment cmt"># File lib/s33r/s3_acl.rb, line 261</span> +261: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) +262: <span class="ruby-keyword kw">nil</span> +263: <span class="ruby-keyword kw">end</span> </pre> </div> </div> </div> \ No newline at end of file