Keep in mind that both method! and method? in ruby methods are a convention and not a ruby functionality per se, and it's different of the !method and !!method in the context of a boolean return. Something curious though: !true === true.!.
Talking about the convention, when I define methods I usually define them with ! if the action is going to modify the object it's called on, or if it's going to raise an exception if something goes wrong. For the ?, the convention is that it will return a boolean.
PS: I love Ruby.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good article.
Keep in mind that both
method!
andmethod?
in ruby methods are a convention and not a ruby functionality per se, and it's different of the!method
and!!method
in the context of a boolean return. Something curious though:!true === true.!
.Talking about the convention, when I define methods I usually define them with
!
if the action is going to modify the object it's called on, or if it's going to raise an exception if something goes wrong. For the?
, the convention is that it will return aboolean
.PS: I love Ruby.