Class: Agent::Lock::Manager::Result
- Inherits:
-
Data
- Object
- Data
- Agent::Lock::Manager::Result
- Defined in:
- lib/agent/lock/manager.rb
Overview
What every Manager verb returns.
Instance Attribute Summary collapse
-
#message ⇒ String?
readonly
A warning worth printing, such as a partial freeze.
-
#records ⇒ Array<Record>
readonly
The records involved, the subject first.
-
#status ⇒ Symbol
readonly
What happened, such as :acquired, :held or :not_found.
Instance Method Summary collapse
-
#code ⇒ Integer
What the process should exit with.
-
#record ⇒ Record?
The one record most results are about.
Instance Attribute Details
#message ⇒ String? (readonly)
Returns a warning worth printing, such as a partial freeze.
30 31 32 33 34 35 36 |
# File 'lib/agent/lock/manager.rb', line 30 Result = Data.define(:status, :records, :message) do # @return [Integer] what the process should exit with def code = %i[held refused not_found interrupted parent_scope occupied].include?(status) ? 1 : 0 # @return [Record, nil] the one record most results are about def record = records.first end |
#records ⇒ Array<Record> (readonly)
Returns the records involved, the subject first.
30 31 32 33 34 35 36 |
# File 'lib/agent/lock/manager.rb', line 30 Result = Data.define(:status, :records, :message) do # @return [Integer] what the process should exit with def code = %i[held refused not_found interrupted parent_scope occupied].include?(status) ? 1 : 0 # @return [Record, nil] the one record most results are about def record = records.first end |
#status ⇒ Symbol (readonly)
Returns what happened, such as :acquired, :held or :not_found.
30 31 32 33 34 35 36 |
# File 'lib/agent/lock/manager.rb', line 30 Result = Data.define(:status, :records, :message) do # @return [Integer] what the process should exit with def code = %i[held refused not_found interrupted parent_scope occupied].include?(status) ? 1 : 0 # @return [Record, nil] the one record most results are about def record = records.first end |
Instance Method Details
#code ⇒ Integer
Returns what the process should exit with.
32 |
# File 'lib/agent/lock/manager.rb', line 32 def code = %i[held refused not_found interrupted parent_scope occupied].include?(status) ? 1 : 0 |
#record ⇒ Record?
Returns the one record most results are about.
35 |
# File 'lib/agent/lock/manager.rb', line 35 def record = records.first |