Closed TiteiKo closed 5 years ago
I updated the docs, now it explicitly suggests subclassing instead of using a lambda https://dry-rb.org/gems/dry-container/registry-and-resolver/#customization I'll close this for now but we may revisit the resolver interface in future.
Using the current code and documentation, a container having a custom resolver won't be able to use
#keys
,#each
,#each_key
or#key?
, with the error that a Proc doesn't have those methods.The workaround I found is by subclassing Dry::Container::Resolver like this:
But I don't understand the benefit of having those four methods delegated to the resolver as they are methods of the container?
Relevant lines of code concerned: