lib/ruby_memoized/memoizer.rb in ruby_memoized-0.1.2 vs lib/ruby_memoized/memoizer.rb in ruby_memoized-0.1.3

- old
+ new

@@ -5,15 +5,15 @@ def initialize(context, method) @context = context @method = method end - def call(*args, &block) - return cache[[args, block]] if cache.has_key?([args, block]) - cache[[args, block]] = context.send(method, *args, &block) + def call(*args, **kwargs, &block) + return cache[[args, kwargs, block]] if cache.has_key?([args, kwargs, block]) + cache[[args, kwargs, block]] = context.send(method, *args, **kwargs, &block) end def cache @cache ||= {} end end -end \ No newline at end of file +end