Created
September 26, 2014 19:34
-
-
Save mlangenberg/6c7319768616251b9886 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
gem 'json', '1.8.1' | |
require 'json' | |
class FooBar | |
def as_json(options = nil) | |
{ foo: 'bar' } | |
end | |
end | |
puts JSON.generate(FooBar.new, quirks_mode: true) | |
gem 'rails', '4.0.10' | |
require 'rails/all' | |
puts JSON.generate(FooBar.new, quirks_mode: true) | |
# OUTPUT: | |
# => "#<FooBar:0x007fa1aa841478>" | |
# => {"foo":"bar"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment