Class: RailsPulse::Adapters::JobWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_pulse/adapters/job_wrapper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_id:, class_name:, queue_name:, arguments:, enqueued_at:, executions:) ⇒ JobWrapper

Returns a new instance of JobWrapper.



8
9
10
11
12
13
14
15
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 8

def initialize(job_id:, class_name:, queue_name:, arguments:, enqueued_at:, executions:)
  @job_id = job_id
  @class_name = class_name
  @queue_name = queue_name
  @arguments = arguments
  @enqueued_at = enqueued_at
  @executions = executions
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



6
7
8
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 6

def arguments
  @arguments
end

#enqueued_atObject (readonly)

Returns the value of attribute enqueued_at.



6
7
8
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 6

def enqueued_at
  @enqueued_at
end

#executionsObject (readonly)

Returns the value of attribute executions.



6
7
8
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 6

def executions
  @executions
end

#job_idObject (readonly)

Returns the value of attribute job_id.



6
7
8
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 6

def job_id
  @job_id
end

#queue_nameObject (readonly)

Returns the value of attribute queue_name.



6
7
8
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 6

def queue_name
  @queue_name
end

Instance Method Details

#classObject



17
18
19
# File 'lib/rails_pulse/adapters/job_wrapper.rb', line 17

def class
  OpenStruct.new(name: @class_name)
end