Class: JobInvocationComposer::ParamsFromJobInvocation

Inherits:
Object
  • Object
show all
Defined in:
app/models/job_invocation_composer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_invocation, params = {}) ⇒ ParamsFromJobInvocation

Returns a new instance of ParamsFromJobInvocation.



229
230
231
232
233
234
235
236
237
238
# File 'app/models/job_invocation_composer.rb', line 229

def initialize(job_invocation, params = {})
  @job_invocation = job_invocation
  if params[:host_ids]
    @host_ids = params[:host_ids]
  elsif params[:failed_only]
    @host_ids = job_invocation.failed_host_ids
  elsif params[:succeeded_only]
    @host_ids = job_invocation.succeeded_host_ids
  end
end

Instance Attribute Details

#job_invocationObject (readonly)

Returns the value of attribute job_invocation.



227
228
229
# File 'app/models/job_invocation_composer.rb', line 227

def job_invocation
  @job_invocation
end

Instance Method Details

#paramsObject



240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'app/models/job_invocation_composer.rb', line 240

def params
  { :job_category => job_invocation.job_category,
    :targeting => targeting_params,
    :triggering => triggering_params,
    :ssh_user => job_invocation.ssh_user,
    :description_format => job_invocation.description_format,
    :concurrency_control => concurrency_control_params,
    :execution_timeout_interval => job_invocation.execution_timeout_interval,
    :remote_execution_feature_id => job_invocation.remote_execution_feature_id,
    :template_invocations => template_invocations_params,
    :time_to_pickup => job_invocation.time_to_pickup,
    :reruns => job_invocation.id }.with_indifferent_access
end