Skip to content

Instantly share code, notes, and snippets.

@jlatt
Created April 2, 2012 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlatt/2287931 to your computer and use it in GitHub Desktop.
Save jlatt/2287931 to your computer and use it in GitHub Desktop.
safe json wrapper
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