Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If initialize is overriden and super is not called inject fails #11

Open
krisleech opened this issue Mar 23, 2015 · 0 comments
Open

If initialize is overriden and super is not called inject fails #11

krisleech opened this issue Mar 23, 2015 · 0 comments

Comments

@krisleech
Copy link
Owner

Because @injections is never set.

We can capture this and report a nice message here if @injections is nil.

Or, we can not initialize @injections in the constructor favouring lazy initialization in the injections method:

def injections
  @injections ||= Injections.new
end

The problem with the above is that, currently, injections returns a immutable value and the method is not used internally, @injections is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant