enummer icon indicating copy to clipboard operation
enummer copied to clipboard

Access and set the underlaying Integer

Open MSchmidt opened this issue 11 months ago • 2 comments

Is there a way to read and write the underlaying integer? I'd like to use enummer for my rails-based stuff but in my JSON API i'd like to just send the Int as it is without the automatic conversion.

MSchmidt avatar Feb 06 '25 14:02 MSchmidt

I've tested what I need for setting Int values here: https://github.com/MSchmidt/enummer/commit/487b538855f00cdf189489a872f479f63c60a42a

It just checks if the passed in value is already an integer and skips the casting.

MSchmidt avatar Feb 06 '25 15:02 MSchmidt

Hey @MSchmidt. Thanks for the PR! I've unfortunately not had time to look at this yet, but it is on my todo list!

shkm avatar Feb 18 '25 08:02 shkm