Interpreting the usage of annotations in Ruby and interpreting ruby annotations
The Code Annotated In the Ruby line is ignored at runtime. Single line comment # starts with the characters. They start from # To the end of the line as follows:
#! /Usr/bin/ruby-w # This is a single line comment. puts "Hello, Ruby! "
When the above program is executed, the following results are generated:
Hello, Ruby!
Ruby multiline comments
You can comment out multiple rows using the = begin and = end syntax as follows:
#! /Usr/bin/ruby-wputs "Hello, Ruby! "= BeginThis is a multiline comment and con spwan as your lines as youlike. But = begin and = end shocould come in the first line only. = end
When the above program is executed, the following results are generated:
Hello, Ruby!
Make sure that the subsequent comments are codes that keep enough distance to make it easy to differentiate. If there is more than one ending end comment in a block, they are aligned. For example:
@ Counter # keeps track times page has been hit @ siteCounter # keeps track of times all pages have been hit