Sha256: 659c781b4b76ac77d03ae694699be4bd9651d460d035e8c91faabcc503d357d3

Contents?: true

Size: 239 Bytes

Versions: 15

Compression:

Stored size: 239 Bytes

Contents

module Sidekiq::LimitFetch::Singleton
  def self.extended(klass)
    klass.instance_variable_set :@instances, {}
  end

  def new(*args)
    @instances[args] ||= super
  end

  alias [] new

  def instances
    @instances.values
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sidekiq-limit_fetch-2.4.0 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.3.0 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.7 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.6 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.5 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.4 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.3 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.2 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.1 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.2.0 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.1.3 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.1.2 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.1.1 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.1.0 lib/sidekiq/limit_fetch/singleton.rb
sidekiq-limit_fetch-2.0.2 lib/sidekiq/limit_fetch/singleton.rb