0
Started

Ruby Singleton using Standard Library Module Singleton

Ricardo Siqueira Oliveira Leit 3 weeks ago updated by Alexander Shvets 3 weeks ago 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
Started

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