Class: RubyReactor::RSpec::ActiveJobHelpers::PendingJob

Inherits:
Struct
  • Object
show all
Defined in:
lib/ruby_reactor/rspec/active_job_helpers.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#job_classObject

Returns the value of attribute job_class

Returns:

  • (Object)

    the current value of job_class



11
12
13
# File 'lib/ruby_reactor/rspec/active_job_helpers.rb', line 11

def job_class
  @job_class
end

#rawObject

Returns the value of attribute raw

Returns:

  • (Object)

    the current value of raw



11
12
13
# File 'lib/ruby_reactor/rspec/active_job_helpers.rb', line 11

def raw
  @raw
end

Instance Method Details

#argsObject



17
18
19
# File 'lib/ruby_reactor/rspec/active_job_helpers.rb', line 17

def args
  raw[:args]
end

#perform!Object



12
13
14
15
# File 'lib/ruby_reactor/rspec/active_job_helpers.rb', line 12

def perform!
  ::ActiveJob::Base.queue_adapter.enqueued_jobs.delete(raw)
  job_class.new(*raw[:args]).perform_now
end