Class: UniqueThread::Lock

Inherits:
Object
  • Object
show all
Defined in:
lib/unique_thread/locksmith.rb

Direct Known Subclasses

HeldLock

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locked_until, stopwatch, locksmith, logger) ⇒ Lock

Returns a new instance of Lock.



54
55
56
57
58
59
# File 'lib/unique_thread/locksmith.rb', line 54

def initialize(locked_until, stopwatch, locksmith, logger)
  @locked_until = locked_until
  @stopwatch    = stopwatch
  @locksmith    = locksmith
  @logger       = logger
end

Instance Attribute Details

#locked_untilObject (readonly)

Returns the value of attribute locked_until.



52
53
54
# File 'lib/unique_thread/locksmith.rb', line 52

def locked_until
  @locked_until
end

#locksmithObject (readonly)

Returns the value of attribute locksmith.



52
53
54
# File 'lib/unique_thread/locksmith.rb', line 52

def locksmith
  @locksmith
end

#loggerObject (readonly)

Returns the value of attribute logger.



52
53
54
# File 'lib/unique_thread/locksmith.rb', line 52

def logger
  @logger
end

#stopwatchObject (readonly)

Returns the value of attribute stopwatch.



52
53
54
# File 'lib/unique_thread/locksmith.rb', line 52

def stopwatch
  @stopwatch
end

Instance Method Details

#acquired?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/unique_thread/locksmith.rb', line 61

def acquired?
  false
end

#while_heldObject



65
66
67
# File 'lib/unique_thread/locksmith.rb', line 65

def while_held
  nil
end