I am just learning Ruby and I don’t quite understand the difference between several Ruby methods with and without a ‘!’ at the end. What’s the difference? Why would I use one over the other?
I am just learning Ruby and I don’t quite understand the difference between several
Share
Methods with an exclamation mark at the end are often called bang-methods. A bang method doesn’t necessarily modify its receiver as well as there is no guarantee that methods without a exclamation mark doesn’t.
It’s all very well explained in this blog post. To quote the post:
and