lib/ehcache/cache.rb in jruby-ehcache-1.0.0 vs lib/ehcache/cache.rb in jruby-ehcache-1.1.0

- old
+ new

@@ -28,10 +28,15 @@ elsif args.size == 2 element = Ehcache::Element.create(args[0], args[1], options) else raise ArgumentError, "Must be Element object or key and value arguments" end - ehcache_put(element) + + if options[:unless_exist] + put_if_absent(element) + else + ehcache_put(element) + end end alias []= put alias include? isKeyInCache