I was reading through some of Why’s parkplace code this afternoon, and I
saw a couple things I wanted to ask people about.
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?
What is this type of class definition all about:
class << self
It seems to be creating singleton methods the same as doing this, except
with more typing:
def ParkPlace.foo # or def self.foo