Created
November 20, 2014 09:50
-
-
Save lengshuiyulangcn/17d2f36ee426cc6d431a to your computer and use it in GitHub Desktop.
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
#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