This is so cool! Using Ruby enums feels like writing poetry to me. Do you like using the &: operator with your enums? (e.g. odd, even = nums.partition(&:odd?) for your first example) I personally like the look of it but I know people are divided.
I really like the look of that as well but I never remember that I can use the &: operator :/. I'm going to add that alternate syntax in the first example as you provided(thank you by the way!), so that others can see both. Giving you credit for providing it as well! :) Glad you thought this was a cool post, thank you!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is so cool! Using Ruby enums feels like writing poetry to me. Do you like using the
&:
operator with your enums? (e.g.odd, even = nums.partition(&:odd?)
for your first example) I personally like the look of it but I know people are divided.I really like the look of that as well but I never remember that I can use the
&:
operator :/. I'm going to add that alternate syntax in the first example as you provided(thank you by the way!), so that others can see both. Giving you credit for providing it as well! :) Glad you thought this was a cool post, thank you!