Module: ActiveJob::Core
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#initialize(*arguments) ⇒ Object
Creates a new job instance.
-
#serialize ⇒ Object
Returns a hash with the job data that can safely be passed to the queueing adapter.
Instance Method Details
#initialize(*arguments) ⇒ Object
Creates a new job instance. Takes as arguments the arguments that will be passed to the perform method.
53 54 55 56 57 |
# File 'lib/active_job/core.rb', line 53 def initialize(*arguments) @arguments = arguments @job_id = SecureRandom.uuid @queue_name = self.class.queue_name end |
#serialize ⇒ Object
Returns a hash with the job data that can safely be passed to the queueing adapter.
61 62 63 64 65 66 67 68 |
# File 'lib/active_job/core.rb', line 61 def serialize { 'job_class' => self.class.name, 'job_id' => job_id, 'queue_name' => queue_name, 'arguments' => serialize_arguments(arguments) } end |