July 2007
Beginner to intermediate
176 pages
2h 30m
English
A comment hides a line, part of a line, or several lines from the Ruby interpreter. You can use the hash character (#) at the beginning of a line:
# I am a comment. Just ignore me.
Or, a comment may be on the same line after a statement or expression:
name = "Floydene" # ain't that a name to beat allYou can make a comment run over several lines, like this:
# This is a comment. # This is a comment, too. # This is a comment, too. # I said that already.
Here is another form. This block comment conceals several lines from the interpreter with =begin/=end:
=begin This is a comment. This is a comment, too. This is a comment, too. I said that already. =end
A block can comment out one line or as many lines as you want.
Read now
Unlock full access