Ruby ignores everything that comes after a #
.
Programmers call it a comment.
Comments are for humans and not for computers.
Computers skip all the comments and do not even look at them.
Ruby will ignore the first line,
because it is a comment.
A comment can start midway too:
In the example given above,
Ruby will process the
statement until it sees
a #
and then it will
ignore the rest of the line.
Note that if a #
appears
inside a string, then Ruby
will not ignore it.
In the example given above, #
is inside a string,
so Ruby will not treat it as a comment.