jcsalterego/ruby-exercises — pull request #1 by jcsalterego (2013-04-07 20:03:51+00:00)
Title: Feedback: dictionary.rb

Refactored two methods and wrote some light tests. Run the unit test with:

$ rake test

Further notes:

* `#add` should have a clear interface, as it's not clear to me why a non-Hash item would just add the key and set the value to `nil`
* In Ruby, a `nil` value in a Hash is equivalent to a missing key; for example:

```ruby
h = Hash.new
h[:foo] = nil
if h[:foo]
puts "yep"
else
puts "nope"
end
# => nope
```

* `kind_of?` is the idiomatic way of checking the class of an object
* I suggest using the same variable name for the same item, e.g. `array_cell` is only used in printable but it's `key` and `value` elsewhere
* I'm not sure why there are quotes around the value in `#printable`?