Well Grounded Rubyist for 2012-07-03

Here are a few more somewhat random notes from chapters 7 and 8 of Well Grounded Rubyist:

Look up the “spaceship operator”.
== tests for equality of contents of strings. equal? tests to see if the strings are the same object (this is how “equal” usually behaves)
String::crypt uses DES. Is DES any good?

begin/rescue/ensure/end is like try/catch/finally in Java. The “ensure” block will always be called.
Bang methods change the caller, like reversing a string instead of returning a reversed string. I thought they swallowed exceptions (I think that is what they did for me in tic-tac-toe).

String interpolation does not happen with single-quoted strings. Other ways to make strings:
%q{}
%Q{}
%{}

Another local developer said that she found Well Grounded Rubyist to be easier to follow and better than the “PickAxe Book”. So far I agree. I have gotten farther in WGR than the PB.

Image from World Digital Library, assumed allowed under Fair Use. Image from the Ashburnham Pentateuch, or Tours Pentateuch, a Latin manuscript of the first five books of the Old Testament from the 6th century or 7th century. Its place of origin is unknown.