Class: Kettle::Family::CommandResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/kettle/family/command_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commandObject

Returns the value of attribute command

Returns:

  • (Object)

    the current value of command



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def command
  @command
end

#elapsed_secondsObject

Returns the value of attribute elapsed_seconds

Returns:

  • (Object)

    the current value of elapsed_seconds



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def elapsed_seconds
  @elapsed_seconds
end

#member_nameObject

Returns the value of attribute member_name

Returns:

  • (Object)

    the current value of member_name



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def member_name
  @member_name
end

#phaseObject

Returns the value of attribute phase

Returns:

  • (Object)

    the current value of phase



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def phase
  @phase
end

#reasonObject

Returns the value of attribute reason

Returns:

  • (Object)

    the current value of reason



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def reason
  @reason
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def skipped
  @skipped
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def status
  @status
end

#stderrObject

Returns the value of attribute stderr

Returns:

  • (Object)

    the current value of stderr



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def stderr
  @stderr
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def stdout
  @stdout
end

#successObject

Returns the value of attribute success

Returns:

  • (Object)

    the current value of success



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def success
  @success
end

#workdirObject

Returns the value of attribute workdir

Returns:

  • (Object)

    the current value of workdir



5
6
7
# File 'lib/kettle/family/command_result.rb', line 5

def workdir
  @workdir
end

Instance Method Details

#ok?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/kettle/family/command_result.rb', line 34

def ok?
  success || skipped
end

#to_hObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/kettle/family/command_result.rb', line 18

def to_h
  {
    "member" => member_name,
    "phase" => phase,
    "command" => command,
    "workdir" => workdir,
    "status" => status,
    "success" => success,
    "stdout" => summarize(stdout),
    "stderr" => summarize(stderr),
    "elapsed_seconds" => elapsed_seconds,
    "skipped" => skipped,
    "reason" => reason
  }
end