From: 7stud -- Date: 2007-10-21T15:57:54+09:00 Subject: Re: Can class methods be in a module? Bazsl wrote: > Is it possible to put a class method in a module, for example: > > module FtpClientMod > def self.do_send(file_template, show_progress) > > and include it in a class as follows? > > require 'ftpclientmod' > > class FtpClient > include FtpClientMod > > When I try this I get an error that the method cannot be found. Maybe this will work for you: module MyMethods def greet puts "hello" end end class Dog include MyMethods extend MyMethods end Dog.greet #hello -- Posted via http://www.ruby-forum.com/.