我有我想要包括类和实例方法的Ruby类。继模式描述here,我目前使用下列内容: class SomeObject
include SomeObject::Ability
def self.some_builder_method(params)
# use some_class_method ...
end
end
module SomeObje
在Java中的具体数目,我创建了一个单例类如下: public class Singleton
{
private Singleton() { print("Singleton Constructor"); }
private static Singleton pointer = new Singleton();//static here so only one object