Created
July 17, 2012 17:54
-
-
Save rmehner/3130828 to your computer and use it in GitHub Desktop.
OpenStruct monkey patch to support id for RUBY_VERSION < 1.9
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
if RUBY_VERSION < '1.9' | |
# monkey patching open struct to allow overwriting id method | |
OpenStruct.__send__(:define_method, :id) { @table[:id] } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment