Commenting code in Ruby

July 1st, 2008

There's two ways to comment code in Ruby. Single lines that commence with a hash (#) are comments, or you can use block commenting:

=begin
This is all commented out.
It spans multiple lines, until we end it.
=end

Every few months I need to comment a big block of code and I always forget how to do it :)

Matthew Lambie

Webmail

Feature Product

  • Raven Communicator Create first-class email campaigns & manage your online marketing with ease. Newsletters, email marketing and subscriber management are effortless with Raven Communicator.
  • Find out more

Subscribe

Enter your email address to subscribe to our mailing list:

Affiliations