Skip to content

Instantly share code, notes, and snippets.

@eprothro
Created September 14, 2017 14:22
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 eprothro/3de2d22c4576359d06e5bd825a9df6ac to your computer and use it in GitHub Desktop.
Save eprothro/3de2d22c4576359d06e5bd825a9df6ac to your computer and use it in GitHub Desktop.
class Foo
  
  def bar
    :object_method
  end
end

f = Foo.new
f.bar
# => :object_method

def f.bar
  :object_metaclass_method
end

f.bar
# => :object_metaclass_method

class << f
  remove_method(:bar)
end

f.bar
# => :object_method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment