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

memoize expensive attributes

This commit is contained in:
Wesley Beary 2009-08-03 22:54:34 -07:00
parent 1ea2938987
commit e8b9e44fe7

View file

@ -12,18 +12,22 @@ module Fog
end
def location
data = s3.get_bucket_location(name)
@location = data.body['LocationConstraint']
@location ||= begin
data = s3.get_bucket_location(name)
data.body['LocationConstraint']
end
end
def payer
data = connection.get_request_payment(name)
data.body['Payer']
@payer ||= begin
data = connection.get_request_payment(name)
data.body['Payer']
end
end
def payer=(new_payer)
connection.put_request_payment(name, new_payer)
new_payer
@payer = new_payer
end
def save