Created
February 7, 2013 04:45
-
-
Save letronje/4728624 to your computer and use it in GitHub Desktop.
private_class_methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Searchable | |
module ClassMethods | |
def magic | |
puts "c"*100 | |
define_method(:instance_method) do | |
self.class.class_helper | |
end | |
end | |
private | |
def class_helper | |
puts "ch"*100 | |
end | |
end | |
end | |
class C | |
extend Searchable::ClassMethods | |
magic | |
end | |
i = C.new | |
i.instance_method | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment