Class: RedisLock::IfLocked

Inherits:
Semaphore show all
Defined in:
lib/redis_lock/if_locked.rb

Instance Attribute Summary

Attributes inherited from Semaphore

#args, #lock

Instance Method Summary collapse

Methods inherited from Semaphore

#initialize

Constructor Details

This class inherits a constructor from RedisLock::Semaphore

Instance Method Details

#call(&block) ⇒ Object



3
4
5
6
# File 'lib/redis_lock/if_locked.rb', line 3

def call(&block)
  return :open if lock.open?
  _perform(&block)
end