I saw a presentation http://essential-rails-pattern.heroku.com/#23 (in Chinese)
and it describe a method called is_spam! to change something to spam.
My question is if make_spam! is a better one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Umm…. I suppose this is somewhat subjective, but considering most methods in ruby that begin with
is(but typically end in?) return a boolean then I suppose I agree;make_spam!is better. I don’t really like the mutating methods though anyway…By convention I personally would name it
to_spam!.