Ranjib| there is n method/instance variable named options inside serialize, to_hash should be invoke on 'body' instead

This commit is contained in:
Ranjib Dey 2012-12-27 13:36:08 -08:00
parent 4a72c529bf
commit bd04489a43
1 changed files with 28 additions and 28 deletions

View File

@ -326,7 +326,7 @@ module Google
# JSON
def serialize_body(body)
return body.to_json if body.respond_to?(:to_json)
return MultiJson.dump(options[:body_object].to_hash) if body.respond_to?(:to_hash)
return MultiJson.dump(body.to_hash) if body.respond_to?(:to_hash)
raise TypeError, 'Could not convert body object to JSON.' +
'Must respond to :to_json or :to_hash.'
end