1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[aws|storage] Added ability to control bucket versioning from Directory model.

This commit is contained in:
Kevin Menard 2011-12-29 14:47:50 -05:00
parent 28df463458
commit 2d084c7844

View file

@ -58,6 +58,17 @@ module Fog
@payer = new_payer
end
def versioning?
requires :key
data = connection.get_bucket_versioning(key)
data.body['VersioningConfiguration']['Status'] == 'Enabled'
end
def versioning=(new_versioning)
requires :key
connection.put_bucket_versioning(key, new_versioning ? 'Enabled' : 'Suspended')
end
def public=(new_public)
if new_public
@acl = 'public-read'