Created
April 12, 2009 10:07
-
-
Save inem/93944 to your computer and use it in GitHub Desktop.
adding to_json method to ostruct
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 OpenStruct | |
def to_json | |
table.to_json | |
end | |
end | |
o = OpenStruct.new | |
o.foo = "foo" | |
o.bar = 1 | |
o.to_json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment