lib/invokr/builder.rb in invokr-0.9.5 vs lib/invokr/builder.rb in invokr-0.9.6
- old
+ new
@@ -5,16 +5,17 @@
builder.build
end
attr :argument_names, :injector, :method, :missing_args, :unused_args
- def initialize method, injector, implicit_block
+ def initialize method, injector, implicit_block, allow_unused = false
@argument_names = method.parameters.map &:last
@injector = injector
@method = method
@opt_arg_name = nil
+ @allow_unused = allow_unused
@block_arg = nil
@implicit_block = implicit_block
@keyword_args = {}
@positional_args = []
@missing_args = []
@@ -22,10 +23,10 @@
set_unused_args
end
def build
handle_args!
- check_for_unused_args!
+ check_for_unused_args! unless @allow_unused
check_for_missing_args!
build_invocation
end
def build_invocation