Post AIx1llj3QuVH7snAsC by jsrn@ruby.social
(DIR) More posts by jsrn@ruby.social
(DIR) Post #AIx1liMbvtlghPGhyS by jsrn@ruby.social
2022-04-29T14:23:55Z
0 likes, 1 repeats
Is there ever a good time to define a custom `!` method on an object? Seems like setting up a footgun for people relying on the truthy/falsiness in a boolean expression.class Thing; def !; true; end; endmy_thing = Thing.newdo_thing if my_thing# executesdo_thing if !my_thing # executesdo_thing unless my_thing # does not execute
(DIR) Post #AIx1llj3QuVH7snAsC by jsrn@ruby.social
2022-04-29T15:15:41Z
0 likes, 0 repeats
Chatted about this with a couple local Ruby programmers and the consensus seems to be "probably not."