Class: Ndo::Result
- Inherits:
-
Object
- Object
- Ndo::Result
- Defined in:
- lib/ndo/result.rb
Overview
Represents a command result for a single host.
Instance Attribute Summary collapse
-
#future ⇒ Object
readonly
Returns the value of attribute future.
-
#host_name ⇒ Object
readonly
Returns the value of attribute host_name.
Instance Method Summary collapse
- #exception ⇒ Object
-
#initialize(host_name, future) ⇒ Result
constructor
A new instance of Result.
- #stderr ⇒ Object
- #stdout ⇒ Object
- #success? ⇒ Boolean
- #value ⇒ Object
Constructor Details
#initialize(host_name, future) ⇒ Result
Returns a new instance of Result.
8 9 10 |
# File 'lib/ndo/result.rb', line 8 def initialize(host_name, future) @host_name, @future = host_name, future end |
Instance Attribute Details
#future ⇒ Object (readonly)
Returns the value of attribute future.
6 7 8 |
# File 'lib/ndo/result.rb', line 6 def future @future end |
#host_name ⇒ Object (readonly)
Returns the value of attribute host_name.
5 6 7 |
# File 'lib/ndo/result.rb', line 5 def host_name @host_name end |
Instance Method Details
#exception ⇒ Object
28 29 30 |
# File 'lib/ndo/result.rb', line 28 def exception value end |
#stderr ⇒ Object
20 21 22 |
# File 'lib/ndo/result.rb', line 20 def stderr value.last end |
#stdout ⇒ Object
16 17 18 |
# File 'lib/ndo/result.rb', line 16 def stdout value.first end |
#success? ⇒ Boolean
24 25 26 |
# File 'lib/ndo/result.rb', line 24 def success? value.kind_of?(Array) end |
#value ⇒ Object
12 13 14 |
# File 'lib/ndo/result.rb', line 12 def value future.value end |