Class: ChefApply::UI::Terminal::Job
- Inherits:
-
Object
- Object
- ChefApply::UI::Terminal::Job
- Defined in:
- lib/chef_apply/ui/terminal/job.rb
Instance Attribute Summary collapse
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
-
#target_host ⇒ Object
readonly
Returns the value of attribute target_host.
Instance Method Summary collapse
-
#initialize(prefix, target_host, &block) ⇒ Job
constructor
A new instance of Job.
- #run(reporter) ⇒ Object
Constructor Details
#initialize(prefix, target_host, &block) ⇒ Job
Returns a new instance of Job.
23 24 25 26 27 28 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 23 def initialize(prefix, target_host, &block) @proc = block @prefix = prefix @target_host = target_host @error = nil end |
Instance Attribute Details
#exception ⇒ Object (readonly)
Returns the value of attribute exception.
22 23 24 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 22 def exception @exception end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
22 23 24 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 22 def prefix @prefix end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
22 23 24 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 22 def proc @proc end |
#target_host ⇒ Object (readonly)
Returns the value of attribute target_host.
22 23 24 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 22 def target_host @target_host end |
Instance Method Details
#run(reporter) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/chef_apply/ui/terminal/job.rb', line 30 def run(reporter) @proc.call(reporter) rescue => e reporter.error(e.to_s) @exception = e end |