Class S33r::S3ACL::Grantee
In: lib/s33r/s3_acl.rb
Parent: Object

Abstract representation of an S3 Grantee.

Methods

==   from_xml   method_missing  

Attributes

grantee_type  [R] 

Public Class methods

[Source]

     # File lib/s33r/s3_acl.rb, line 265
265:       def self.from_xml(grantee_xml)
266:         grantee_type = grantee_xml['type']
267: 
268:         case grantee_type
269:           when GRANTEE_TYPES[:amazon_customer]
270:             AmazonCustomer.new(grantee_xml.xget('EmailAddress'))
271:           when GRANTEE_TYPES[:canonical_user]
272:             CanonicalUser.from_xml(grantee_xml)
273:           when GRANTEE_TYPES[:group]
274:             uri = grantee_xml.xget('URI')
275:             # last part of the path is the group type
276:             path = uri.gsub(/#{GROUP_ACL_URI_BASE}/, '')
277: 
278:             group_type = :all_users
279:             S3_GROUP_TYPES.each { |k,v| group_type = k if v == path }
280:             Group.new(group_type)
281:         end
282:       end

Public Instance methods

[Source]

     # File lib/s33r/s3_acl.rb, line 248
248:       def ==(obj)
249:         if !obj.is_a?(Grantee)
250:           return false
251:         end
252:         instance_variables.each do |var|
253:           method_name = var.gsub(/^@/, '')
254:           if self.send(method_name) != obj.send(method_name)
255:             return false
256:           end
257:         end
258:         return true
259:       end

[Source]

     # File lib/s33r/s3_acl.rb, line 261
261:       def method_missing(*args)
262:         nil
263:       end

[Validate]