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



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



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



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

def result
  @result
end

Instance Method Details

#lock_was_acquired?Boolean



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

def lock_was_acquired?
  lock_was_acquired
end