lib/map.rb in map-2.6.1 vs lib/map.rb in map-2.7.0
- old
+ new
@@ -1,7 +1,7 @@
class Map < Hash
- Version = '2.6.1' unless defined?(Version)
+ Version = '2.7.0' unless defined?(Version)
Load = Kernel.method(:load) unless defined?(Load)
class << Map
def version
Map::Version
@@ -565,10 +565,12 @@
key = args.shift.to_s.chomp('=')
value = args.shift
self[key] = value
else
key = method
- super(*args, &block) unless has_key?(key)
+ unless has_key?(key)
+ return(block ? fetch(*args, &block) : super(*args))
+ end
self[key]
end
end
def id