In Ruby some methods have a question mark (?
) that ask a question like include?
that ask if the object in question is included, this then returns a
!
I like to think of this as an explosive change that destroys all that has gone before it. Bang or exclamation mark means that you are making a permanent saved change in your code.
If you use for example Ruby's method for global substitutiongsub!
the substitution you make is permanent.
Another way you can imagine it, is opening a text file and doing find and replace, followed by saving. !
does the same in your code.
Another useful reminder if you come from the bash world is sed -i
has this similar effect of making permanent saved change.