Class: RedisLock::IfOpen

Inherits:
Strategy show all
Defined in:
lib/redis_lock/if_open.rb

Instance Attribute Summary

Attributes inherited from Strategy

#args, #lock

Instance Method Summary collapse

Methods inherited from Strategy

#after_perform, #initialize

Constructor Details

This class inherits a constructor from RedisLock::Strategy

Instance Method Details

#call(&block) ⇒ Object



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

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