Class: ActiveadminJobs::JobResultRenderer
- Inherits:
-
Object
- Object
- ActiveadminJobs::JobResultRenderer
- Defined in:
- lib/activeadmin_jobs/job_result_renderer.rb
Instance Attribute Summary collapse
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(page) ⇒ JobResultRenderer
constructor
A new instance of JobResultRenderer.
- #render ⇒ Object
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
#job ⇒ Object (readonly)
Returns the value of attribute job.
3 4 5 |
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 3 def job @job end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
3 4 5 |
# File 'lib/activeadmin_jobs/job_result_renderer.rb', line 3 def page @page end |
#result ⇒ Object (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
#render ⇒ Object
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 |