Learning? Read Split-s.
Split-s, a nice blog for getting down some basic Ruby concepts. The code here on RedHanded can be pretty heavy handed sometimes—I’m completely out of touch with each of your pressing needs—so I’ll defer to split-s when it comes to topics such as conditional initialization. Which culminates in an explanation of this snip:
def addToList(key, value) (@map[key] ||= ) << value end
Martin also codes in Java—expect some comparisons. If you lack know-how on duck typing, take a gander at yesterday’s Quack, Quack.