lib/dry/component/injector.rb in dry-component-0.1.0 vs lib/dry/component/injector.rb in dry-component-0.2.0
- old
+ new
@@ -8,18 +8,18 @@
# @api private
attr_reader :injector
# @api private
- def initialize(container, strategy: :args, strategies_cache: nil)
+ def initialize(container, strategy: nil, strategies_cache: nil)
@container = container
@strategies = strategies_cache
-
- @injector = if strategy == :args
- Dry::AutoInject(container)
- else
- Dry::AutoInject(container).send(strategy)
- end
+ @injector =
+ if strategy
+ Dry::AutoInject(container).send(strategy)
+ else
+ Dry::AutoInject(container)
+ end
end
# @api public
def [](*deps)
load_components(*deps)