hi andrew!

Andrew Stewart [2008-01-15 18:32]:
> I believe one can add methods to a class by including a module
> but not override existing methods.
well, you *can* override them explicitly:

  module Bar
    def self.included(base)
      methods_to_override = %w[answer]
                          # or even <tt>instance_methods(false)</tt>

      methods_to_override.each { |method|
        base.send(:define_method, method, instance_method(method))
      }
    end
  end

if that's what you want... ;-)

cheers
jens

-- 
Jens Wille, Dipl.-Bibl. (FH)
prometheus - Das verteilte digitale Bildarchiv f?r Forschung & Lehre
Kunsthistorisches Institut der Universit?t zu K?ln
Albertus-Magnus-Platz, D-50923 K?ln
Tel.: +49 (0)221 470-6668, E-Mail: jens.wille / uni-koeln.de
http://www.prometheus-bildarchiv.de/