Skip to content

Instantly share code, notes, and snippets.

@rmehner
Created July 17, 2012 17:54
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 rmehner/3130828 to your computer and use it in GitHub Desktop.
Save rmehner/3130828 to your computer and use it in GitHub Desktop.
OpenStruct monkey patch to support id for RUBY_VERSION < 1.9
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