Ruby Comments

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


Ruby Comments

As seen in example Ruby Hello World, comments in ruby are done with pound (#) sign.

#!/usr/bin/ruby
# This is a comment1
# This is a comment2
# This is a comment3

We can have multiple line comments in Ruby as follows using =begin and =end.

#!/usr/bin/ruby
=begin
Ruby comment begins here
Ruby comment  here
Ruby comment  here
Ruby comment ends here
=end





0 points

Very informative post. Thanks for taking the time to share your view with us.

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.