ruby:

Working with Hashes in Ruby (Part 2 of 2)

Syntax rules for using hashes.


Working with Hashes in Ruby (Part 1 of 2)

Syntax rules for using hashes.


Manipulating Arrays in Ruby (Part 2 of 2)

Syntax rules for manipulating arrays.


Manipulating Arrays in Ruby (Part 1 of 2)

Syntax rules for manipulating arrays.


Accessing Arrays in Ruby

Syntax rules for accessing elements of an array.

Creating Arrays in Ruby

Syntax rules for creating and initializing arrays in Ruby. Examples and discussion of Array.new; array literals; %w and %W for arrays of strings; initializing an array with the values of another array


Ranges in Ruby

Brief introduction to Ranges in Ruby with syntax for defining inclusive and exclusive ranges using the two types of Range operators; the membership operator (===), or case equality operator, and an example of a range being used in a case statement; iterating over a range using the each and step methods.


Strings and Mutability in Ruby

Mutability in Strings and Constants; the freeze method for creating immutable objects; the frozen? method; the dup method for making a mutable copy of a frozen object.


Symbols in Ruby

Syntax rules for Symbols in Ruby and consideration of potential performance issues when deciding between Strings and Symbols. Also discussed: the symbol table; differences in memory persistence between strings and symbols; symbol lookup; benchmarking symbol vs string performance; functional distinctions between symbols and strings


String Delimiters in Ruby

String Delimiters in Ruby including a discussion of how escaped characters are treated differently in single vs double-quoted strings; using %q and %Q for nonstandard delimiters; here documents; and, string interpolation.


Loops in Ruby

Syntax rules for looping, including: while, begin/end, break, until, Kernel.loop, for/in


Conditions in Ruby

Syntax rules for if, elsif, else, unless, the ternary operator, case statements.


Methods in Ruby

Syntax rules for methods in Ruby. Using 'def' and 'end'. The optional 'return' keyword. Naming conventions for boolean methods (?), destructive methods (!) and setters (=). Using default arguments and a variable number of arguments. The alias keyword.


Variable Scope in Ruby

A brief discussion of local, global, class and instance variables in the context of variable scope.


Duck Typing in Ruby

A brief discusion of "duck typing" or dynamic typing in Ruby with examples.


Whitespace In Ruby

Syntax rules of whitespace in the Ruby programming language with respect to continuation of statements over multiple lines of code.


Identifiers in Ruby

Syntax rules for identifiers in the Ruby programming language.