From: Brian Candler Date: 2010-10-21T17:48:01+09:00 Subject: Re: First Law of Classes Mike Stephens wrote in post #955941: > Now I think there ought to be a rule that a class is not a class if it > only has methods. It might be a module if you want to wrap it neatly. Technically, if it's just procedures with no mixins, there's no particular reason for it to be a module either. # example 1 module Foo def self.foo puts "Method in module" end end # example 2 Bar = Object.new def Bar.bar puts "Method in object" end Foo.foo Bar.bar > If you saw a class without persistent data, would you be suspicious? Not really. A class is_a module anyway. It's neater to use module just to document that you don't expect any instances to be created. I would avoid the global variables though, and instead use instance variables of the class/module/whatever container. That makes them a bit less 'global'. -- Posted via http://www.ruby-forum.com/.