Skip to content

Instantly share code, notes, and snippets.

@benjaminws
Created July 17, 2013 19:18
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 benjaminws/6023579 to your computer and use it in GitHub Desktop.
Save benjaminws/6023579 to your computer and use it in GitHub Desktop.
found in some rubby
%w{ crazy method names all over the place }.each do |method|
class_eval "def #{method}; self[:'#{method}']; end"
class_eval "def #{method}=(value); self[:'#{method}'] = value; end"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment