[Borges-users] refactoring

Eric Hodel drbrain at segment7.net
Sun May 2 22:48:44 EDT 2004


wilkes joiner (wilkesjoiner at gmail.com) wrote:

> In other languages, I typically put class methods at the top of the
> class definition.  For example
> 
> Java or C-suck:
> class A {
>     public static A aFactoryMethod() {}
>     public static void ClassLevelSetter {}
>     // you get the picture
> }
> 
> so I really like the class << self thing in Ruby.  It provides a
> natural grouping of class methods that makes code easier for me to
> read, your mileage may vary.
> 
> class A
>   class << self
>     ## all my class methods
>    end
> end

I like its use primarily for grouping.  Its easy to see which methods
are class methods and ignore them.

-- 
Eric Hodel - drbrain at segment7.net - http://segment7.net
All messages signed with fingerprint:
FEC2 57F1 D465 EB15 5D6E  7C11 332A 551C 796C 9F04

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/borges-users/attachments/20040502/8ebe91b3/attachment.bin


More information about the Borges-users mailing list