Class: WithAdvisoryLock::Result
- Inherits:
-
Data
- Object
- Data
- WithAdvisoryLock::Result
- 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
-
#lock_was_acquired ⇒ Object
readonly
Returns the value of attribute lock_was_acquired.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(lock_was_acquired:, result: nil) ⇒ Result
constructor
A new instance of Result.
- #lock_was_acquired? ⇒ Boolean
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_acquired ⇒ Object (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 |
#result ⇒ Object (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 |