# File lib/aws/s3/acl_options.rb, line 108 def acl_options acl case acl when Symbol { :acl => acl.to_s.tr('_', '-') } when String # Strings are either access control policies (xml strings) # or they are canned acls xml?(acl) ? { :access_control_policy => acl } : { :acl => acl } when AccessControlList { :access_control_policy => acl.to_xml } when Hash # Hashes are either grant hashes or constructor args for an # access control list (deprecated) grant_hash?(acl) ? format_grants(acl) : { :access_control_policy => AccessControlList.new(acl).to_xml } else # failed to parse the acl option msg = "expected a canned ACL, AccessControlList object, ACL " "XML string or a grants hash" raise ArgumentError, msg end end