Module: ActiveJob::Temporal::ChainOptions
- Defined in:
- lib/activejob/temporal/chain_options.rb
Constant Summary collapse
- SUPPORTED_CONFIGURED_OPTIONS =
%i[priority queue].freeze
Instance Attribute Summary collapse
-
#temporal_chain ⇒ Object
readonly
Returns the value of attribute temporal_chain.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#temporal_chain ⇒ Object (readonly)
Returns the value of attribute temporal_chain.
13 14 15 |
# File 'lib/activejob/temporal/chain_options.rb', line 13 def temporal_chain @temporal_chain end |
Class Method Details
.normalize(chain) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/activejob/temporal/chain_options.rb', line 15 def self.normalize(chain) return nil if chain.nil? raise ArgumentError, "chain must be an Array of ActiveJob classes or configured jobs" unless chain.is_a?(Array) raise ArgumentError, "chain must contain at least one ActiveJob class or configured job" if chain.empty? chain.map { |job_class| normalize_job_class(job_class) } end |
Instance Method Details
#set(options = {}) ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/activejob/temporal/chain_options.rb', line 71 def set( = {}) = .dup normalized_chain = ChainOptions.normalize(.delete(:chain)) if .key?(:chain) super().tap do @temporal_chain = normalized_chain if .key?(:chain) end end |