Closed laertispappas closed 7 years ago
Looks great. Just missing CHANGELOG entry please.
Feel free to make a release with this @laertispappas.
Sure. I will. Thanks.
This change has caused some issues in my projects that rely on ruby-enum:
NameError: wrong constant name default
from <path/to/gem>/lib/ruby-enum/enum.rb:34:in `const_set'
The definition of my enum is here.
Am I doing something wrong? I'm not sure why this redefinition error change would now start raising NameError
.
@gjtorikian Can you reopen a new issue? Maybe with a failing test, please?
Define constant with const_set instead of "fetching" them with const_missing. These changes were proposed by @dmoss18 in his initial PR (https://github.com/dblock/ruby-enum/pull/11).
I kept const_missing method in order to raise the custom Ruby::Enum::Errors::DuplicateKeyError since it provides a handy way to inform the end user for the exception raised.