Class: WithAdvisoryLock::Result

Inherits:
Data
  • Object
show all
Defined in:
lib/with_advisory_lock/result.rb

Overview

Result object that indicates whether a lock was acquired and the result of the block

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lock_was_acquired:, result: nil) ⇒ Result

Returns a new instance of Result.



6
7
8
# File 'lib/with_advisory_lock/result.rb', line 6

def initialize(lock_was_acquired:, result: nil)
  super
end

Instance Attribute Details

#lock_was_acquiredObject (readonly)

Returns the value of attribute lock_was_acquired

Returns:

  • (Object)

    the current value of lock_was_acquired



5
6
7
# File 'lib/with_advisory_lock/result.rb', line 5

def lock_was_acquired
  @lock_was_acquired
end

#resultObject (readonly)

Returns the value of attribute result

Returns:

  • (Object)

    the current value of result



5
6
7
# File 'lib/with_advisory_lock/result.rb', line 5

def result
  @result
end

Instance Method Details

#lock_was_acquired?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/with_advisory_lock/result.rb', line 10

def lock_was_acquired?
  lock_was_acquired
end