Skip to content

Instantly share code, notes, and snippets.

@awendt
Created September 8, 2011 10:07
Show Gist options
  • Save awendt/1203071 to your computer and use it in GitHub Desktop.
Save awendt/1203071 to your computer and use it in GitHub Desktop.
HTTParty: Using native json parser instead of Crack
# This was proposed by @ericgj in
# https://github.com/jnunemaker/httparty/issues/75#issuecomment-1258914
# using native json parser instead of Crack
class JsonParser < HTTParty::Parser
def json
::JSON.parse(body)
end
end
class MyClient
include HTTParty
parser JsonParser
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment