DEV Community

Discussion on: Ruby's Partition Method

Collapse
 
emilysamp profile image
Emily Samp

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.

Collapse
 
collinjilbert profile image
Collin

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!