lib/hashr.rb in hashr-2.0.0.rc1 vs lib/hashr.rb in hashr-2.0.0.rc2
- old
+ new
@@ -74,10 +74,10 @@
defined?(key) ? self[key] : nil # TODO needs to look for to_h etc
end
def to_h
@data.inject({}) do |hash, (key, value)|
- hash.merge(key => value.respond_to?(:to_h) ? value.to_h : value)
+ hash.merge(key => value.is_a?(Hashr) || value.is_a?(Hash) ? value.to_h : value)
end
end
alias to_hash to_h
def ==(other)