These are chat archives for dry-rb/chat

7th
Dec 2018
Grant Shangreaux
@gcentauri
Dec 07 2018 17:36
is it counterproductive to add methods to structs? i'm primarily thinking of predicate type methods that would only return true or false based on the data the struct is holding
like, if i had a struct Fruit and if its name field was "banana" then my_fruit.banana? would return true. or... should there be helper functions like is_banana?(fruit)
Nikita Shilnikov
@flash-gordon
Dec 07 2018 17:41
I do have a few methods like this, don't see anything harmful since it's not the same as having an AR-model :)
Grant Shangreaux
@gcentauri
Dec 07 2018 17:53
haha thanks
ruby often feels like a slippery slope to me in those regards