Class: Bolt::PlanResult
- Inherits:
-
Object
- Object
- Bolt::PlanResult
- Defined in:
- lib/bolt/plan_result.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
-
.from_pcore(result, status) ⇒ Object
This must be called from inside a compiler.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value, status) ⇒ PlanResult
constructor
A new instance of PlanResult.
- #ok? ⇒ Boolean
- #to_json(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value, status) ⇒ PlanResult
Returns a new instance of PlanResult.
23 24 25 26 |
# File 'lib/bolt/plan_result.rb', line 23 def initialize(value, status) @value = value @status = status end |
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
9 10 11 |
# File 'lib/bolt/plan_result.rb', line 9 def status @status end |
#value ⇒ Object
Returns the value of attribute value.
9 10 11 |
# File 'lib/bolt/plan_result.rb', line 9 def value @value end |
Class Method Details
.from_pcore(result, status) ⇒ Object
This must be called from inside a compiler
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bolt/plan_result.rb', line 12 def self.from_pcore(result, status) result = Bolt::Util.walk_vals(result) do |v| if v.is_a?(Puppet::DataTypes::Error) Bolt::PuppetError.from_error(v) else v end end new(result, status) end |
Instance Method Details
#==(other) ⇒ Object
32 33 34 |
# File 'lib/bolt/plan_result.rb', line 32 def ==(other) value == other.value && status == other.status end |
#ok? ⇒ Boolean
28 29 30 |
# File 'lib/bolt/plan_result.rb', line 28 def ok? @status == 'success' end |
#to_json(*args) ⇒ Object
36 37 38 |
# File 'lib/bolt/plan_result.rb', line 36 def to_json(*args) @value.to_json(*args) end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/bolt/plan_result.rb', line 40 def to_s to_json end |