Robert Klemme wrote:
> Yes.  Strictly speaking there are no static methods in Ruby.  But it has
> the concept of singleton methods that are defined for a single instance
> only.  And since classes are just ordinary objects you can define
> instance methods of class objects and achieve basically the same as with
> Java's static methods:
> 
> class Foo
>    def self.a_class_method
>      # ...
>    end
> 
>    def an_instance_method
>      self.class.a_class_method
>      self.another_class_method
>    end
> end
> 
So if i have a class method, I can invoke that method from anywhere by 
using class name like: Foo.a_class_method() without declaring public for 
that method?

-- 
Posted via http://www.ruby-forum.com/.