06-10-2012, 11:57 AM
Ruby Tutorial
ruby_tutorial.pdf (Size: 955.37 KB / Downloads: 73)
What is Ruby ?
Ruby is a pure object oriented programming language. It was created in 1993 by Yukihiro Matsumoto of Japan. Ruby is a general-purpose, interpreted programming language like PERL and Python.
What is IRb ?
Interactive Ruby (IRb) provides a shell for experimentation. Within the IRb shell, you can immediately view expression results, line by line.
This tool comes along with Ruby installation so you have nothing to do extra to have IRb working. Just type irb at your command prompt and an Interactive Ruby Session will start.
Ruby Syntax:
Whitespace characters such as spaces and tabs are generally ignored in Ruby code, except when they appear in strings.
Ruby interprets semicolons and newline characters as the ending of a statement. However, if Ruby encounters operators, such as +, -, or backslash at the end of a line, they indicate the continuation of a statement.
Identifiers are names of variables, constants, and methods. Ruby identifiers are case sensitive. It mean Ram and RAM are two different itendifiers in Ruby.
Ruby comments start with a pound/sharp (#) character and go to EOL.