From: Jeff Rose Date: 2006-05-10T23:49:37+09:00 Subject: where do you require? I was reading through some of Why's parkplace code this afternoon, and I saw a couple things I wanted to ask people about. (http://code.whytheluckystiff.net/parkplace/browser/trunk/lib/parkplace.rb) 1) What's the effect of doing a require inside a method like in ParkPlace#config or ParkPlace#serve? It's just a method right, so it will re-require every time the method is called? Since it's getting loaded inside a method does it garbage collect the library after the method returns? (Maybe do it to save memory?) What's the behavior with bindings that use dynamically linked libraries? 2) What is this type of class definition all about: module ParkPlace class << self def foo end end end It seems to be creating singleton methods the same as doing this, except with more typing: module ParkPlace def ParkPlace.foo # or def self.foo end end Thanks, Jeff