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

[core] coerce service credentials

This commit is contained in:
geemus 2011-09-06 13:38:03 -05:00
parent cea6fd3edf
commit 4f466e2672

View file

@ -56,6 +56,7 @@ module Fog
end
validate_options(options)
coerce_options(options)
setup_requirements
if Fog.mocking?
@ -114,6 +115,24 @@ module Fog
@collections ||= []
end
def coerce_options(options)
options.each do |key, value|
value_string = value.to_s.downcase
if value == value_string.to_i.to_s
options[key] = value.to_i
else
options[key] = case value_string
when 'false'
false
when 'true'
true
else
value
end
end
end
end
def mocked_requests
@mocked_requests ||= []
end