lib/beanstalker/extend.rb in beanstalker-0.4.3 vs lib/beanstalker/extend.rb in beanstalker-0.4.4

- old
+ new

@@ -41,15 +41,15 @@ class_variable_set(:@@methods_async_options, methods_async_options.merge(method.to_sym => options)) end end end - def interpolate_async_options(options, object) + def interpolate_async_options(options, object, *args) result = {} options.each do |k,v| result[k] = if v.is_a?(Proc) - v.call(object) + v.call(object, *args) else v end end result @@ -58,10 +58,10 @@ def async_send(selector, *args) async_send_opts(selector, @@methods_async_options[selector.to_sym] || {}, *args) end def async_send_opts(selector, opts, *args) - interpolated_options = interpolate_async_options(opts, self) + interpolated_options = interpolate_async_options(opts, self, *args) Beanstalker::Queue.put_call!(self, selector, interpolated_options, args) end end CLASSES_TO_EXTEND.each do |c|