Class: Ndo::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/ndo/result.rb

Overview

Represents a command result for a single host.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#futureObject (readonly)

Returns the value of attribute future.



6
7
8
# File 'lib/ndo/result.rb', line 6

def future
  @future
end

#host_nameObject (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

#exceptionObject



28
29
30
# File 'lib/ndo/result.rb', line 28

def exception
  value
end

#stderrObject



20
21
22
# File 'lib/ndo/result.rb', line 20

def stderr
  value.last
end

#stdoutObject



16
17
18
# File 'lib/ndo/result.rb', line 16

def stdout
  value.first
end

#success?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/ndo/result.rb', line 24

def success?
  value.kind_of?(Array)
end

#valueObject



12
13
14
# File 'lib/ndo/result.rb', line 12

def value
  future.value
end