check for nil in ruby client's to_hash method

Fixes https://github.com/gilt/apidoc/issues/214
Merge pull request #217 from gilt/ruby-to-hash-fix

check for nil in ruby client's to_hash method