-
Notifications
You must be signed in to change notification settings - Fork 4
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
Deprecate constant lookups via .const_missing #10
Conversation
* Store the feature tree as nested hashes * Add simplified query methods * Continue to support constant lookups
398e885
to
5a5e115
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks good to me 👍
06cbf65
to
21deac3
Compare
@@ -0,0 +1,47 @@ | |||
class Feature::ConstantLookup | |||
Error = Class.new(NameError) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just define this as, you know,
class Error < NameError do
...
end
Anonymous classes often feel like a code smell to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not an anonymous class, just a different way to declare a subclass.
Error = Class.new(StandardError) | ||
Unknown = Class.new(Error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question
Constant lookups are terrible. They cause cryptic errors and are hard to test without message expectations.