Make toJSON method more rubyish