From: Florian Gilcher Date: 2009-12-14T13:33:59+09:00 Subject: Re: about object methods On 13 déc. 2009, at 23:46, Ruby Newbee wrote: > Hello, > > I have two questions, > > 1. what's the difference between class method and module method? > 2. when I say: Dir.pwd, is this a class method or a module method? How > to know if Dir is a module or a class? If you check Class.ancestors, you will find that classes are modules. The only difference is that classes have methods like #new and #allocate. So, in your case: it doesn't really matter, but you could check: Dir.respond_to? :new For the methods themselves, there is no difference anyways: they belong to objects. Whether that is a class, a module or something else make so difference. Regards, Florian