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.



159
160
161
162
163
164
165
166
# File 'app/models/job_invocation_composer.rb', line 159

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
  end
end

Instance Attribute Details

#job_invocationObject (readonly)

Returns the value of attribute job_invocation.



157
158
159
# File 'app/models/job_invocation_composer.rb', line 157

def job_invocation
  @job_invocation
end

Instance Method Details

#paramsObject



168
169
170
171
172
173
174
175
176
# File 'app/models/job_invocation_composer.rb', line 168

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