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:
parent
1ea2938987
commit
e8b9e44fe7
1 changed files with 9 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue