From: Dave Thomas Date: 2000-07-05T11:31:19-05:00 Subject: [ruby-talk:03838] Re: Order of overwriting Aleksi Niemel� writes: > Now I think it will change into: > > class Foo # change to a here-comes-a-class-definition(-remember- > # to-scan-through-the-definition-first) > def foo > end > include "Bar" # whee, here we have it, now we can start to read method > # definitions > end Sorry, but you'll have to change again ;-) Ruby doesn't really differentiate this way. The body of the class definition is also executable code: puts "Before" class Dave puts "In Dave" end puts "End" => Before In Dave End The thing that might be confusing is remembering that Ruby finds its methods dynamically. It doesn't matter when a method is added to a class or one of of its ancestors, it's simply a question of what's present in the ancestor chain at the time the method is called. Regards Dave