Created
April 2, 2012 23:22
-
-
Save jlatt/2287931 to your computer and use it in GitHub Desktop.
safe json wrapper
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
class JSONSafe | |
def initialize(value) | |
@value = value | |
end | |
def to_json(*args) | |
@value | |
end | |
def as_json(*args) | |
self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment