Class: Logical::Naf::ConstructionZone::AdHocWorkOrder

Inherits:
WorkOrder
  • Object
show all
Defined in:
app/models/logical/naf/construction_zone/ad_hoc_work_order.rb

Instance Attribute Summary

Attributes inherited from WorkOrder

#application, #application_run_group_limit, #application_run_group_name, #application_run_group_restriction, #application_schedule, #application_type, #command, #enqueue_backlogs, #priority

Instance Method Summary collapse

Methods inherited from WorkOrder

#historical_job_affinity_tab_parameters, #historical_job_parameters, #historical_job_prerequisite_historical_jobs

Constructor Details

#initialize(*parameters) ⇒ AdHocWorkOrder

Returns a new instance of AdHocWorkOrder.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/models/logical/naf/construction_zone/ad_hoc_work_order.rb', line 3

def initialize(*parameters)
  maybe_hash = parameters.first
  if maybe_hash.is_a?(Hash)
    super(maybe_hash[:command],
          maybe_hash[:application_type] || ::Naf::ApplicationType.rails,
          maybe_hash[:application_run_group_restriction] || ::Naf::ApplicationRunGroupRestriction.limited_per_all_machines,
          maybe_hash[:application_run_group_name] || :command,
          maybe_hash[:application_run_group_limit] || 1,
          maybe_hash[:priority] || 0,
          maybe_hash[:affinities] || [],
          maybe_hash[:prerequisites] || [],
          maybe_hash[:enqueue_backlogs] || false,
          maybe_hash[:application] || nil,
          maybe_hash[:application_schedule] || nil)
  else
    super(*parameters)
  end
end