From: Chris White Date: 2011-08-05T01:20:17+09:00 Subject: Re: Corrections in a Class On Aug 4, 2011, at 9:05 AM, Rubyist Rohit wrote: > Below is the code of my initial Class in the Ruby world. I want to make > this Class a static class so that I can directly call methods, > connectViaFTP and disconnectFTP. > > public def connectViaFTP You don't need to put "public" before your method, especially if you want to make it a singleton method. public is already the default access type. To make this a singleton method, simply put either the name of the class, or self before it: def self.connectViaFTP ... end or def EstablishRemoteConnection.connectViaFTP .. end and there's also this interesting format: class EstablishRemoteConnection class << self def connectViaFTP .. end end end These all have the same result of being able to do this: EstablishRemoteConnection.connectViaFTP Also as a side note Ruby naming conventions are generally in the form: connect_ftp without any sort of camel casing or such. Class/Module names are the ones that tend to utilize camel case. Whatever works for you though. Though you might also want to keep your class names a bit shorter: RemoteConnection.ftp_connection Regards, Chris White Twitter: http://www.twitter.com/cwgem