Module: Ddr::Jobs::Job::ClassMethods
- Defined in:
- lib/ddr/jobs/job.rb
Instance Method Summary collapse
-
#queued_object_ids(**args) ⇒ Array<String>
List of object ids queued for this job type.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (protected)
20 21 22 23 24 25 26 |
# File 'lib/ddr/jobs/job.rb', line 20 def method_missing(name, *args, &block) # If .queue method not defined, do the right thing if name == :queue return Resque.queue_from_class(self) end super end |
Instance Method Details
#queued_object_ids(**args) ⇒ Array<String>
Note:
Assumes that the object_id is the first argument of the .perform method.
Returns list of object ids queued for this job type.
13 14 15 16 |
# File 'lib/ddr/jobs/job.rb', line 13 def queued_object_ids(**args) args[:type] = self __queue__.jobs(**args).map { |job| job["args"].first } end |