Ruby Basics
Ruby Advanced
Ruby Useful Resources
Selected Reading
- Ruby - Exceptions
- Ruby - File I/O
- Ruby - Iterators
- Ruby - Ranges
- Ruby - Date & Time
- Ruby - Hashes
- Ruby - Arrays
- Ruby - Strings
- Ruby - Modules
- Ruby - Blocks
- Ruby - Methods
- Ruby - Loops
- Ruby - IF...ELSE
- Ruby - Comments
- Ruby - Operators
- Ruby - Variables
- Ruby - Classes and Objects
- Ruby - Syntax
- Ruby - Environment Setup
- Ruby - Overview
- Ruby - Home
Ruby Advanced
- Ruby - Associated Tools
- Ruby - Predefined Constants
- Ruby - Predefined Variables
- Ruby - Built-in Functions
- Ruby - Multithreading
- Ruby - Ruby/LDAP Tutorial
- Ruby - Tk Guide
- Ruby - Web Services
- Ruby - Ruby/XML, XSLT
- Ruby - Socket Programming
- Ruby - Sending Email
- Ruby - Web Applications
- Ruby - Database Access
- Ruby - Regular Expressions
- Ruby - Object Oriented
Ruby Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Ruby - Comments
Ruby - Comments
Comments are pnes of annotation within Ruby code that are ignored at runtime. A single pne comment starts with # character and they extend from # to the end of the pne as follows −
#!/usr/bin/ruby -w # This is a single pne comment. puts "Hello, Ruby!"
When executed, the above program produces the following result −
Hello, Ruby!
Ruby Multipne Comments
You can comment multiple pnes using =begin and =end syntax as follows −
#!/usr/bin/ruby -w puts "Hello, Ruby!" =begin This is a multipne comment and con spwan as many pnes as you pke. But =begin and =end should come in the first pne only. =end
When executed, the above program produces the following result −
Hello, Ruby!
Make sure traipng comments are far enough from the code and that they are easily distinguished. If more than one traipng comment exists in a block, apgn them. For example −
@counter # keeps track times page has been hit @siteCounter # keeps track of times all pages have been hitAdvertisements