Class: QueueProcessor::DependentCalculation::QueueControl::CalculationRequest

Inherits:
Struct
  • Object
show all
Defined in:
lib/queue-processor/dependent_calculation/queue_control.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clazzObject

Returns the value of attribute clazz

Returns:

  • (Object)

    the current value of clazz



38
39
40
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 38

def clazz
  @clazz
end

#commentObject

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



38
39
40
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 38

def comment
  @comment
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



38
39
40
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 38

def id
  @id
end

#queued_atObject

Returns the value of attribute queued_at

Returns:

  • (Object)

    the current value of queued_at



38
39
40
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 38

def queued_at
  @queued_at
end

Instance Method Details

#display_nameObject



48
49
50
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 48

def display_name
  comment
end

#performObject



39
40
41
42
43
44
45
46
# File 'lib/queue-processor/dependent_calculation/queue_control.rb', line 39

def perform
  obj = clazz.where(:id => id).first
  if obj.present?
      obj.process_queued_calculation
  else
    Rails.logger.warn("#{clazz.to_s} #{id}: does not exist")
  end
end