home PYTHONJAVA
 

Ruby comment

Comments are remark lines inside Ruby code that are disregarded at runtime. Single-line remarks start with the # character until the stopping point, as follows:

Instance

#!/usr/receptacle/ruby - w # This is a one-line comment. puts "Hello, Ruby!"

When executed, the above program will deliver the accompanying results:

Hello, Ruby!

Ruby multi-line comments

You can clarify different lines utilizing the =begin and =end language structure as follows:

Instance

#!/usr/container/ruby - w puts "Hello, Ruby!" =begin This is a multi-line remark. Can be reached out to any number of lines. In any case, =begin and =end can just show up on the first and last lines. =end

When executed, the above program will deliver the accompanying results:

Hello, Ruby!

Make beyond any doubt that the trailing remarks are sufficiently far from the code to make it simpler to recognize remarks and code. On the off chance that the tail surpasses a remark, adjust them. For example:

Instance

@counter # Tracking the occasions a page was clicked @siteCounter # Track the occasions all pages were clicked





welookups is optimized for learning.© welookups. 2018 - 2019 All Right Reserved and you agree to have read and accepted our term and condition.