Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kamipo
Created April 22, 2020 08:46
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 kamipo/0cc96ad51e68d2f92edfcfc88742e7a5 to your computer and use it in GitHub Desktop.
Save kamipo/0cc96ad51e68d2f92edfcfc88742e7a5 to your computer and use it in GitHub Desktop.
puts RUBY_VERSION
module Rails
end
def Rails.root; :defined_root end
p defined?(Rails.root)
Rails.instance_eval { undef :root }
p defined?(Rails.root)
@kamipo
Copy link
Author

kamipo commented Apr 22, 2020

% ruby undef.rb
2.8.0
"method"
"method"

% ruby undef.rb
2.7.0
"method"
nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment