lib/map.rb in map-3.0.0 vs lib/map.rb in map-4.0.0
- old
+ new
@@ -1,7 +1,7 @@
class Map < Hash
- Version = '3.0.0' unless defined?(Version)
+ Version = '4.0.0' unless defined?(Version)
Load = Kernel.method(:load) unless defined?(Load)
class << Map
def version
Map::Version
@@ -239,10 +239,11 @@
end
def self.convert_value(value)
conversion_methods.each do |method|
#return convert_value(value.send(method)) if value.respond_to?(method)
- if value.respond_to?(method)
+ hashlike = value.is_a?(Hash)
+ if hashlike and value.respond_to?(method)
value = value.send(method)
break
end
end