module SimpleMutex

Constants

VERSION

Attributes

logger[RW]
redis[RW]

Public Class Methods

no_redis_error() click to toggle source
# File lib/simple_mutex.rb, line 37
def no_redis_error
  "You should set SimpleMutex.redis before using any functions of this gem."
end
no_sidekiq_pro_error() click to toggle source
# File lib/simple_mutex.rb, line 41
def no_sidekiq_pro_error
  "Batch related functionality requires Sidekiq Pro to be installed."
end
redis_check!() click to toggle source
# File lib/simple_mutex.rb, line 25
def redis_check!
  raise Error, no_redis_error unless redis
end
sidekiq_pro_check!() click to toggle source
# File lib/simple_mutex.rb, line 29
def sidekiq_pro_check!
  raise Error, no_sidekiq_pro_error unless sidekiq_pro_installed?
end
sidekiq_pro_installed?() click to toggle source
# File lib/simple_mutex.rb, line 33
def sidekiq_pro_installed?
  Object.const_defined?("Sidekiq::Pro::VERSION")
end

Private Instance Methods

no_redis_error() click to toggle source
# File lib/simple_mutex.rb, line 37
def no_redis_error
  "You should set SimpleMutex.redis before using any functions of this gem."
end
no_sidekiq_pro_error() click to toggle source
# File lib/simple_mutex.rb, line 41
def no_sidekiq_pro_error
  "Batch related functionality requires Sidekiq Pro to be installed."
end
redis_check!() click to toggle source
# File lib/simple_mutex.rb, line 25
def redis_check!
  raise Error, no_redis_error unless redis
end
sidekiq_pro_check!() click to toggle source
# File lib/simple_mutex.rb, line 29
def sidekiq_pro_check!
  raise Error, no_sidekiq_pro_error unless sidekiq_pro_installed?
end
sidekiq_pro_installed?() click to toggle source
# File lib/simple_mutex.rb, line 33
def sidekiq_pro_installed?
  Object.const_defined?("Sidekiq::Pro::VERSION")
end