0
已开始

Ruby Singleton using Standard Library Module Singleton

Ricardo Siqueira de Oliveira L 5 年 前 更新人: anonymous 5 年 前 1

I think to first example without Thread Safe could be use Standard Library Module Singleton

Example:

    require 'singleton'
    class Shop
      include Singleton
    end

    shop = Shop.instance
已开始

Thanks, Ricardo! You might be totally right, I'll check it with the guy who helped me with Ruby examples.

UserEcho 的客户支持