7 ms·
FIY, you can write `data4.all?(Integer)` because `all?` can take a pattern instead of a block, and it uses the === (just like case...when) I just learned this
by greenpeas 3y ago
FIY, you can write `data4.all?(Integer)` because `all?` can take a pattern instead of a block, and it uses the === (just like case...when)
I just learned this myself from another comment in this thread.
UPD: why do you write `obj.<=(16)` instead of `obj <= 16`? is this a performance thing or a matter of style or something else?
- Lammy 3y agoJust a style thing. I find it less visually overwhelming when every statement that contributes a true/false is visually contiguous. You can see it in context here if curious: https://github.com/okeeblow/DistorteD/blob/NEW%E2%80%85SENSATION/Globe%20Glitter/lib/globeglitter.rb https://github.com/okeeblow/DistorteD/blob/NEW%E2%80%85SENSA...