Skip to content

Instantly share code, notes, and snippets.

@ckhrysze
Created September 10, 2013 17:34
Show Gist options
  • Save ckhrysze/6512817 to your computer and use it in GitHub Desktop.
Save ckhrysze/6512817 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
class HasMethods
def method1
return 3
end
def method2
return 7
end
end
one = HasMethods.new
two = HasMethods.new
puts one.method1
puts two.method1
puts one.method2
puts two.method2
class << two
undef_method :method2
end
puts '-'*25
puts one.method1
puts two.method1
puts one.method2
puts two.method2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment