Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Forbidden Fruit: A Taste of Ruby's ParseTree


Published on

My Goruco 2008 presentation on Parse Tree and friends.

Published in: Technology, Education
  • PDF too:
    Are you sure you want to  Yes  No
    Your message goes here

Forbidden Fruit: A Taste of Ruby's ParseTree

  1. 1. Chris Wanstrath
  2. 2. • define_method • • instance_eval • send
  3. 3. class Person singleton = (class self; self end) tons_of_class_methods.each do |name, body| singleton.send(:define_method, name, ) end end
  4. 4. class Class def singleton (class self; self end) end def define_class_method(name, ) singleton.send(:define_method, name, ) end end
  5. 5. class Person tons_of_class_methods.each do |name, body| define_class_method name, end end
  6. 6. Ruby is powerful
  7. 7. 'rake'.sub 'r', 's'