Skip to content

Instantly share code, notes, and snippets.

@lengshuiyulangcn
Created November 20, 2014 09:50
Show Gist options
  • Save lengshuiyulangcn/17d2f36ee426cc6d431a to your computer and use it in GitHub Desktop.
Save lengshuiyulangcn/17d2f36ee426cc6d431a to your computer and use it in GitHub Desktop.
#define 1377 classes with different names and each has one class method with different names and one instance methtod with different names
def leet_classes
(1..1337).to_a.map do |i|
Object.const_set("FooBar_#{i}", Class.new {
define_singleton_method("class_method_#{i}") { "class_method_value_#{i}" }
define_method("instance_method_#{i}") { "instance_method_value_#{i}" }
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment