lib/surrogate/options.rb in surrogate-0.4.3 vs lib/surrogate/options.rb in surrogate-0.5.0
- old
+ new
@@ -18,21 +18,21 @@
def to_hash
options
end
- def default(instance, args, block, &no_default)
+ def default(instance, invocation, &no_default)
if options.has_key? :default
options[:default]
elsif default_proc
# This works for now, but it's a kind of crappy solution because
# BindableBlock adds and removes methods for each time it is invoked.
#
# A better solution would be to instantiate it before passing it to
# the options, then we only have to bind it to an instance and invoke
BindableBlock.new(instance.class, &default_proc)
.bind(instance)
- .call(*args, &block)
+ .call(*invocation.args, &invocation.block)
else
no_default.call
end
end
end