Class: S33r::S3ACL::CanonicalUser
Overview
An S3 user.
Instance Attribute Summary collapse
-
#display_name ⇒ Object
Returns the value of attribute display_name.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Attributes inherited from Grantee
Class Method Summary collapse
-
.from_xml(user_xml_doc) ⇒ Object
Create a user object from an XML fragment with ID and DisplayName elements.
Instance Method Summary collapse
-
#initialize(user_id, display_name) ⇒ CanonicalUser
constructor
owner_xml_doc
: XML::Document or Node instance, representing an <Owner> node from inside a ListBucketResult <Contents> element (see docs.amazonwebservices.com/AmazonS3/2006-03-01/) or an ACL <Grantee> element. - #to_s ⇒ Object
Methods inherited from Grantee
Constructor Details
#initialize(user_id, display_name) ⇒ CanonicalUser
owner_xml_doc
: XML::Document or Node instance, representing an <Owner> node from inside a ListBucketResult <Contents> element (see docs.amazonwebservices.com/AmazonS3/2006-03-01/) or an ACL <Grantee> element.
270 271 272 273 274 |
# File 'lib/s33r/s3_acl.rb', line 270 def initialize(user_id, display_name) @grantee_type = GRANTEE_TYPES[:canonical_user] @user_id = user_id @display_name = display_name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class S33r::S3ACL::Grantee
Instance Attribute Details
#display_name ⇒ Object
Returns the value of attribute display_name.
264 265 266 |
# File 'lib/s33r/s3_acl.rb', line 264 def display_name @display_name end |
#user_id ⇒ Object
Returns the value of attribute user_id.
264 265 266 |
# File 'lib/s33r/s3_acl.rb', line 264 def user_id @user_id end |
Class Method Details
.from_xml(user_xml_doc) ⇒ Object
Create a user object from an XML fragment with ID and DisplayName elements. (Both ACL documents and bucket listings represent users this way.)
279 280 281 282 283 |
# File 'lib/s33r/s3_acl.rb', line 279 def self.from_xml(user_xml_doc) user_id = user_xml_doc.xget('ID') display_name = user_xml_doc.xget('DisplayName') new(user_id, display_name) end |
Instance Method Details
#to_s ⇒ Object
285 286 287 |
# File 'lib/s33r/s3_acl.rb', line 285 def to_s "Canonical user '#{@display_name}' (with user ID '#{@user_id}')" end |