Ruby - Introduction Comments

Introduction

You can place a comment after the hash mark (#).

The text on a line following this character is all treated as a comment:

Demo

# this is a comment 
puts( "hello" ) # this is also a comment

Result

To comment out multiple lines of text, you can place =begin at the start and =end at the end.

Both =begin and =end must be flush with the left margin:

=begin 
  This is a  
  multiline 
  comment 
=end