Skip to content

Instantly share code, notes, and snippets.

@toto
Created November 17, 2009 19:10
Show Gist options
  • Save toto/237165 to your computer and use it in GitHub Desktop.
Save toto/237165 to your computer and use it in GitHub Desktop.
DEFAULT_OPTIONS.keys.each do |key|
define_method key do
return options[key.to_sym] unless options.nil?
end
define_method "#{key}=".to_sym do |value|
returning(options || {}) do |opt|
options[key.to_sym] = value
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment