Allow initializing enummer with hash
Similar to the Rails enum behavior, allow initializing an enummer with a hash where the values correspond to the indices of the bits that map to the flag.
This is a more robust and backwards-compatible approach to enums, as the developer doesn't have to worry about migrating historical data if an enum value is removed.
I also took the liberty of running standardrb on the entire project, seeing as the gem is part of the development dependencies.
Thanks again for this useful gem!
Hi and thanks for the PRs! I'll definitely give them a look as soon as I have a spare moment!
Hey hey! Would you mind looking at the conflicts, @GabrielNagy?
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
6fd34bf) to head (b051e9e). Report is 4 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #22 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 70 71 +1
Branches 8 9 +1
=========================================
+ Hits 70 71 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey hey! Would you mind looking at the conflicts, @GabrielNagy?
All done, thanks!
I've pushed an additional commit to fix another issue I ran into while using enummer. It's completely unrelated to the functionality introduced by the PR at hand but I added it here to avoid conflicts and such.
Let me know if you want me to open a separate PR for it @shkm. Thanks!
Cheers! Thanks for cutting a new release too 🎉