Closed laertispappas closed 7 years ago
@dblock Could you please review this?
I don't love relying on an exception. Maybe we can check the value being passed in? If it's an all uppercase string we do one thing, otherwise we do another? I'm not sure it's better though, what do you think?
Agree! I thought about it too but I didn't want o make things more complex and add if decisions based on the first character of the enum name. We could isolate the const_set
in a begin rescue block but still it's cryptic to rely on the exception. I will proceed with you proposal. Thanks
This looks good, merged. Maybe release?
Sure I will prepare it.
Addresses issue #17 and adds support for non constant definitions. Although there is no example in the docs where we define enums in lowercase some are using
Ruby::Enum
as follows: