Ruby: Comments

In Ruby we can add comments to our code in two ways

  1. Single line comments
  2. Multi-line comments

For single line comments, we use # before the comment to be added.

For eg: #this is a comment

For multi-line comment; we use =begin at the start and =end at the end.

For eg:

=begin

I want to add

multi line

comment

=end

Note: There should be no space between = and begin/end