class DeepPreloader::PolymorphicSpec
def self.parse(data)
def self.parse(data) if data.is_a?(Hash) specs = data.each_with_object({}) do |(k, v), h| h[k.to_s] = DeepPreloader::Spec.parse(v) end self.new(specs) else raise ArgumentError.new("Invalid polymorphic spec: '#{data.inspect}' is not a hash") end end