Created
November 30, 2011 20:12
-
-
Save tenderlove/1410608 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# 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 | |
looks great, this should definitely be in Rails 3.2
Yeah, @tenderlove, Y U NO ADD TESTS? :'(
NAILED IT!!! <3 Solved once and forever, for every use case!!! <3 <3 <3 <3 <3
hawt!
As a leader in the ruby community, @tenderlove should be setting a good example by providing only well-tested code.
bwaha.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't know, I really wish we could get something simpler, like Wycat's MVC JS framework. This one has too much untested code too. -1