module AWS::S3::BitTorrent::ClassMethods
Adds methods to S3Object for accessing the torrent of a given object.
Public Instance Methods
grant_torrent_access_to(key, bucket = nil)
click to toggle source
Grants access to the object with the given key
to be accessible as a torrent.
# File lib/aws/s3/bittorrent.rb 38 def grant_torrent_access_to(key, bucket = nil) 39 policy = acl(key, bucket) 40 return true if policy.grants.include?(:public_read) 41 policy.grants << ACL::Grant.grant(:public_read) 42 acl(key, bucket, policy) 43 end
Also aliased as: grant_torrent_access
torrent_for(key, bucket = nil)
click to toggle source
Returns the torrent file for the object with the given key
.
# File lib/aws/s3/bittorrent.rb 32 def torrent_for(key, bucket = nil) 33 get(path!(bucket, key) << '?torrent').body 34 end
Also aliased as: torrent