a.rb in map-4.3.0 vs a.rb in map-4.4.0
- old
+ new
@@ -1,7 +1,44 @@
require 'map'
-m = Map.new
+#m = Map.new
+#m.default = []
+
+class Errors < ::Map
+ def [](key)
+ self[key] = Array.new unless has_key?(key)
+ super
+ end
+end
-m.default = []
+e = Errors.new
+p e[:k]
+p e
+e.set(:a, :b, 42)
+p e.get(:a, :b)
+p e
+#m = Map.new{|m,k| m[k] ||= Array.new}
-m.get(:a, :b)
+
+#m.set(:a, :b, 42)
+#p m.get(:a, :b)
+
+
+#m[:a].push(:b)
+#p m[:a]
+#p m
+#p m
+
+
+__END__
+args = [:a, :b, {:k => :v}]
+
+Map.update_options_for!(args) do |options|
+ options[:foo] = :bar
+end
+
+Map.update_options_for!(args) do |options|
+ options[:time] = Time.now
+end
+
+p args
+