Weitere ähnliche Inhalte
Ähnlich wie Forbidden Fruit: A Taste of Ruby's ParseTree (20)
Kürzlich hochgeladen (20)
Forbidden Fruit: A Taste of Ruby's ParseTree
- 3. class Person
singleton = (class self; self end)
tons_of_class_methods.each do |name, body|
singleton.send(:define_method, name, )
end
end
- 4. class Class
def singleton
(class self; self end)
end
def define_class_method(name, )
singleton.send(:define_method, name, )
end
end
- 5. class Person
tons_of_class_methods.each do |name, body|
define_class_method name,
end
end