Skip to content

Instantly share code, notes, and snippets.

@seebq
Created December 13, 2011 02:33
Show Gist options
  • Save seebq/1470193 to your computer and use it in GitHub Desktop.
Save seebq/1470193 to your computer and use it in GitHub Desktop.
Don't alter the method parameter
class Car
# http://ruby-doc.org/docs/ProgrammingRuby/html/ref_c_object.html#Object.method_missing
def method_missing(method, *args, &block)
# don't do:
method.gsub!("gasoline", "electricity")
# also don't do:
method = method.to_s
# ...
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment