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

[core] making collection.new error more idiomatic

This commit is contained in:
geemus 2011-05-27 11:17:32 -07:00
parent 5cf271ff6c
commit 96a5c2f46a

View file

@ -94,7 +94,9 @@ module Fog
end
def new(attributes = {})
raise ArgumentError, "Initialization parameters must be an attributes hash, got #{attributes.inspect}" unless attributes.respond_to? :merge
unless attributes.is_a?(Hash)
raise(ArgumentError.new("Initialization parameters must be an attributes hash, got #{attributes.inspect}"))
end
model.new(
attributes.merge(
:collection => self,