module AWS::S3::BitTorrent::ClassMethods

Adds methods to S3Object for accessing the torrent of a given object.

Public Instance Methods

grant_torrent_access(key, bucket = nil)
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, line 38
def grant_torrent_access_to(key, bucket = nil)
  policy = acl(key, bucket)
  return true if policy.grants.include?(:public_read)
  policy.grants << ACL::Grant.grant(:public_read)
  acl(key, bucket, policy)
end
Also aliased as: grant_torrent_access
torrent(key, bucket = nil)
Alias for: torrent_for
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, line 32
def torrent_for(key, bucket = nil)
  get(path!(bucket, key) << '?torrent').body
end
Also aliased as: torrent