lib/map.rb in map-2.5.1 vs lib/map.rb in map-2.6.0

- old
+ new

@@ -1,7 +1,7 @@ class Map < Hash - Version = '2.5.1' unless defined?(Version) + Version = '2.6.0' unless defined?(Version) Load = Kernel.method(:load) unless defined?(Load) class << Map def version Map::Version @@ -46,12 +46,12 @@ new(*args, &block) end def coerce(other) case other - when self - return other + when Map + other else allocate.update(other.to_hash) end end @@ -227,10 +227,14 @@ end end def self.convert_value(value) conversion_methods.each do |method| - return coerce(value.send(method)) if value.respond_to?(method) + #return convert_value(value.send(method)) if value.respond_to?(method) + if value.respond_to?(method) + value = value.send(method) + break + end end case value when Hash coerce(value)