Skip to content

Instantly share code, notes, and snippets.

@tenderlove
Created November 30, 2011 20:12
Show Gist options
  • Save tenderlove/1410608 to your computer and use it in GitHub Desktop.
Save tenderlove/1410608 to your computer and use it in GitHub Desktop.
###
# This is a JSON building library. It allows you to build data structures
# to dump as JSON. Here is a sample of how to use it:
#
# def person_hash(person)
# {
# 'name' => person.name,
# 'age' => person.age,
# 'friends' => person.friends.map { |x| person_hash x }
# }
# end
#
# JSON.dump person_hash Person.find 1
@mikekelly
Copy link

bwaha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment