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 module Utils
attr_accessor :region
def cdn def cdn
@cdn ||= Fog::AWS::CDN.new( @cdn ||= Fog::AWS::CDN.new(
:aws_access_key_id => @aws_access_key_id, :aws_access_key_id => @aws_access_key_id,
@ -93,15 +95,6 @@ module Fog
"#{@host}/#{params[:path]}?#{query.join('&')}" "#{@host}/#{params[:path]}?#{query.join('&')}"
end end
def host
@host
end
def region
region = @region || host.split('.').first.gsub(/s3-?/, '')
region.empty? ? 'us-east-1' : region
end
end end
class Mock class Mock