Class: ActiveJob::Temporal::JobDescriptor
- Inherits:
-
Object
- Object
- ActiveJob::Temporal::JobDescriptor
- Defined in:
- lib/activejob/temporal/job_descriptor.rb
Instance Attribute Summary collapse
-
#job_class ⇒ Object
readonly
Returns the value of attribute job_class.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(job_class, options = {}) ⇒ JobDescriptor
constructor
A new instance of JobDescriptor.
- #to_h ⇒ Object
Constructor Details
#initialize(job_class, options = {}) ⇒ JobDescriptor
Returns a new instance of JobDescriptor.
16 17 18 19 |
# File 'lib/activejob/temporal/job_descriptor.rb', line 16 def initialize(job_class, = {}) @job_class = normalize_job_class(job_class) @options = .dup end |
Instance Attribute Details
#job_class ⇒ Object (readonly)
Returns the value of attribute job_class.
8 9 10 |
# File 'lib/activejob/temporal/job_descriptor.rb', line 8 def job_class @job_class end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/activejob/temporal/job_descriptor.rb', line 8 def @options end |
Class Method Details
.normalize(value) ⇒ Object
10 11 12 13 14 |
# File 'lib/activejob/temporal/job_descriptor.rb', line 10 def self.normalize(value) return value.to_h if value.is_a?(self) nil end |
Instance Method Details
#to_h ⇒ Object
21 22 23 24 25 26 |
# File 'lib/activejob/temporal/job_descriptor.rb', line 21 def to_h { job_class: job_class.name, options: .dup } end |