Your SlideShare is downloading. ×
0
×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Ruby's Object Model: Metaprogramming and other Magic

23,003

Published on

My talk from Winnipeg.rb 2010-10

My talk from Winnipeg.rb 2010-10

Published in: Technology
4 Comments
65 Likes
Statistics
Notes
  • There are some interesting corrections in the thread on reddit: http://www.reddit.com/r/ruby/comments/e0g1s/a_look_into_rubys_object_model/c14d0xq
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • @Alexandr It made more sense when I was explaining this in person, but I was trying to contrast two different methods that ruby _could_ have used to implement modules. I sort of explained some of the consequences of copying a module at include time, and why that's a bad idea. Slide 44 explains the other possible method, and the way ruby actually does it.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • hm... not supports formatting


    module M;def m()puts '1';end;end;
    class C;include M;end;
    module M;def m()puts '2';end;end;
    puts C.new.m
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • What does it mean?
    p43 '... saves a snapshot of the module at time of include'

    1 module M
    2 def m
    3 puts '1'
    4 end
    5 end
    6
    7 class C
    8 include M
    9 end
    10
    11
    12 module M
    13 def m
    14 puts '2'
    15 end
    16 end
    17
    18
    19 C.new.m

    => 2
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
23,003
On Slideshare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
611
Comments
4
Likes
65
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide




























































  • ×