Class: ActiveadminJobs::JobResultRenderer

Inherits:
Object
  • Object
show all
Defined in:
lib/activeadmin_jobs/job_result_renderer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ JobResultRenderer

Returns a new instance of JobResultRenderer.



5
6
7
8
9
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 5

def initialize(page)
  @page = page
  @job = @page.resource
  @result = @job.result
end

Instance Attribute Details

#jobObject (readonly)

Returns the value of attribute job.



3
4
5
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 3

def job
  @job
end

#pageObject (readonly)

Returns the value of attribute page.



3
4
5
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 3

def page
  @page
end

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 3

def result
  @result
end

Instance Method Details

#renderObject



11
12
13
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 11

def render
  page.render(partial: partial_path, locals: { job: job, result: formatted_result })
end