Class: ChefApply::UI::Terminal::Job
- Inherits:
-
Object
- Object
- ChefApply::UI::Terminal::Job
- Defined in:
- lib/chef_apply/ui/terminal.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.
29 30 31 32 33 34 |
# File 'lib/chef_apply/ui/terminal.rb', line 29 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.
28 29 30 |
# File 'lib/chef_apply/ui/terminal.rb', line 28 def exception @exception end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
28 29 30 |
# File 'lib/chef_apply/ui/terminal.rb', line 28 def prefix @prefix end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
28 29 30 |
# File 'lib/chef_apply/ui/terminal.rb', line 28 def proc @proc end |
#target_host ⇒ Object (readonly)
Returns the value of attribute target_host.
28 29 30 |
# File 'lib/chef_apply/ui/terminal.rb', line 28 def target_host @target_host end |
Instance Method Details
#run(reporter) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/chef_apply/ui/terminal.rb', line 36 def run(reporter) @proc.call(reporter) rescue => e reporter.error(e.to_s) @exception = e end |