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

[storage|aws] simplify region accessor

This commit is contained in:
geemus 2011-08-04 09:41:02 -05:00
parent 49b7c122ab
commit 3a6c9f1979

View file

@ -55,6 +55,8 @@ module Fog
module Utils
attr_accessor :region
def cdn
@cdn ||= Fog::AWS::CDN.new(
:aws_access_key_id => @aws_access_key_id,
@ -92,16 +94,7 @@ module Fog
query << "Expires=#{params[:headers]['Date']}"
"#{@host}/#{params[:path]}?#{query.join('&')}"
end
def host
@host
end
def region
region = @region || host.split('.').first.gsub(/s3-?/, '')
region.empty? ? 'us-east-1' : region
end
end
class Mock