From: Trans Date: 2007-09-01T07:10:37+09:00 Subject: Re: python-style decorators On Aug 31, 12:47 pm, "Robert Dober" wrote: > Still trying to get the problem > I know that you know (do I?) that you can do > module M > def foo; "foo" end > end > class X > extend M > end > > where's the catch? When you want class-level methods that go along with your instance methods. module M def self.foo @foo ||= {} end def foo self.class.foo end end Class X include M end X.new.foo #=> ERROR If one could include singletons, the solution would be as simple as: class X extend(class << Foo; self; end) end But as things are you need some sort of "trick". T.