2010-05-16 12:09:25 -04:00
|
|
|
module Fog
|
2010-09-14 13:40:02 -04:00
|
|
|
class Vcloud < Fog::Service
|
2010-05-16 12:09:25 -04:00
|
|
|
class Collection < Fog::Collection
|
|
|
|
|
2010-06-17 19:58:09 -04:00
|
|
|
def load(objects)
|
|
|
|
objects = [ objects ] if objects.is_a?(Hash)
|
|
|
|
super
|
2010-06-07 12:18:06 -04:00
|
|
|
end
|
|
|
|
|
2010-10-17 19:06:44 -04:00
|
|
|
def check_href!(opts = {})
|
|
|
|
unless href
|
|
|
|
if opts.is_a?(String)
|
|
|
|
t = Hash.new
|
|
|
|
t[:parent] = opts
|
|
|
|
opts = t
|
|
|
|
end
|
|
|
|
msg = ":href missing, call with a :href pointing to #{if opts[:message]
|
|
|
|
opts[:message]
|
|
|
|
elsif opts[:parent]
|
|
|
|
"the #{opts[:parent]} whos #{self.class.to_s.split('::').last.downcase} you want to enumerate"
|
|
|
|
else
|
|
|
|
"the resource"
|
|
|
|
end}"
|
|
|
|
raise Fog::Errors::Error.new(msg)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2010-05-16 12:09:25 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|