Comments
There are basically two ways of commenting in ruby:
# This is a comment
str = 'hello' # this is a string
p str # now string
.chars # now array
=begin
this is not parsed as code
until we reach the..
=end
You can use strings as comments, if you don’t mind creating string instances.
"This is a number
and it's 37"
a = 37
If you want comments or notes in the middle of instructions…
NOT breaking lines…
you can use tap
or this:
class Object; def nb! = self.tap {}; end
str = 'hello again!'
p str.nb! {"String is here"}.chars.nb! {"Now it's Array"}