Forbidden Fruit: A Taste of Ruby's ParseTree

8,464 views

Published on

My Goruco 2008 presentation on Parse Tree and friends.

Published in: Technology, Education
1 Comment
10 Likes
Statistics
Notes
  • PDF too: http://errtheblog.com/static/pdfs/goruco2008.pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
8,464
On SlideShare
0
From Embeds
0
Number of Embeds
32
Actions
Shares
0
Downloads
63
Comments
1
Likes
10
Embeds 0
No embeds

No notes for slide

Forbidden Fruit: A Taste of Ruby's ParseTree

  1. 1. Chris Wanstrath http://github.com/defunkt
  2. 2. • define_method • Class.new • 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'

×