Skip to content

Instantly share code, notes, and snippets.

@letronje
Created February 7, 2013 04:45
Show Gist options
  • Save letronje/4728622 to your computer and use it in GitHub Desktop.
Save letronje/4728622 to your computer and use it in GitHub Desktop.
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