Class: QueueProcessor::DependentCalculationGroup::QueueControl::CalculationRequest

Inherits:
Struct
  • Object
show all
Defined in:
lib/queue-processor/dependent_calculation_group/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_group/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_group/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_group/queue_control.rb', line 38

def id
  @id
end

Instance Method Details

#display_nameObject



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

def display_name
  "queue dependent calculations for #{comment}"
end

#performObject



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

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