basho/taste-of-riak — pull request #5 by danieldreier (2014-09-13 05:40:39+00:00)
Title: Symbolize keys in ruby example

In [UserRepository.get()](https://github.com/basho/taste-of-riak/blob/master/ruby/Ch03-Msgy-Schema/Msgy.rb#L45) in the ruby example, the re-created user object doesn't quite work.

When the object is serialized into JSON, the symbols in the hash (:user_name) get turned into "user_name" instead. When they're loaded again, hashie doesn't automatically map those over to the symbols it expects.

One workaround would be to use `include Hashie::Extensions::SymbolizeKeys` and then `User.new(riak_obj.data.symbolize_keys)`.

This PR adds several cases of `include Hashie::Extensions::SymbolizeKeys` and switches all object creation to `riak_obj.data.symbolize_keys`

Without this, running the code results in errors like:
```
/Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:189:in `fail_no_property_error!': The property 'owner' is not defined for Timeline. (NoMethodError)
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:167:in `assert_property_exists!'
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:119:in `[]='
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:162:in `block in initialize_attributes'
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:161:in `each_pair'
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:161:in `initialize_attributes'
from /Users/danieldreier/.rvm/gems/ruby-2.1.2@tasteofruby/gems/hashie-3.3.1/lib/hashie/dash.rb:93:in `initialize'
from Msgy.rb:102:in `new'
from Msgy.rb:102:in `get_timeline'
from Msgy.rb:180:in `

'
```

Thanks for your awesome documentation and examples. Getting started with riak / ruby has been really straightforward.