Software Engineers Handbook/Language Dictionary/Ruby

Ruby
The wikipedia entry is here.

Type
Ruby is a full objected-oriented language.

Execution Entry Point


General Syntax


Comments
Pound signs (#) designate comments in Ruby
 * 1) this is an inline comment.  Everything after the # is a comment.

Variable Declarations
Ruby does not require explicit variable declarations. The following is perfectly valid Ruby code x = 5 (x:5) z = x+3 (z:8) string = 'a string' (string:'a string') longstring = string+string (longstring:'a stringa string')

Yet there are times when a declaration of type is necessary. In the following operation the array named 'objects' must be defined as an array so it can use the << method of adding elements to the array objects = [] objects << "my 1st array elements" objects << "my 2nd array element" objects << 52+3 (objects: ["my 1st array element", "my 2nd array element", 55])

Method Declaration/Implementation


Scope


Conditional Statements


Looping Statements


Output Statements


Error Handling/Recovery


Containers


Algorithms


Garbage collection


Physical Structure


Tips


Web References


Books and Articles
