These are some references that might help you in using Ruby:
- Language
General Syntax Rules
Reserved words
- Comments start with a sharp (#) character and go to EOL.
- Ruby programs are sequence of expressions.
- Each expression is delimited by semicolons(;) or newlines
- Backslashes at the end of line does not terminate expression.
alias and BEGIN begin break case class def defined do else elsif END end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield
Type
Basic types are
numbers, strings, ranges, regexen, symbols, arrays, and hashes. Also included are files because they are used so often.
Variables
$ global_variable @@ class_variable @ instance_variable [OtherClass::]CONSTANT local_variable
- Standard Library
Ruby comes with an extensive library of classes and modules. Some are built-in, and some are part of the standard library. You can distinguish the two by the fact that the built-in classes are in fact, built-in. There are no dot-rb files for them.
Built-in Library
Class Hierarchy:
Object
- Hash
- Symbol
- IO
- File
- Continuation
- File::Stat
- Data
- NilClass
- Exception (see tree above)
- Array
- Proc
- String
Thanks
Sriram










0 comments: