Class: ConfCtl::HealthChecks::RunCommand::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/confctl/health_checks/run_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, opts) ⇒ Command

Returns a new instance of Command.



74
75
76
77
78
79
80
81
82
# File 'lib/confctl/health_checks/run_command.rb', line 74

def initialize(machine, opts)
  @description = opts['description']
  @command = make_command(machine, opts['command'])
  @exit_status = opts['exitStatus']
  @stdout = Output.new(opts['standardOutput'])
  @stderr = Output.new(opts['standardError'])
  @timeout = opts['timeout']
  @cooldown = opts['cooldown']
end

Instance Attribute Details

#commandArray<String> (readonly)

Returns:

  • (Array<String>)


57
58
59
# File 'lib/confctl/health_checks/run_command.rb', line 57

def command
  @command
end

#cooldownInteger (readonly)

Returns:

  • (Integer)


72
73
74
# File 'lib/confctl/health_checks/run_command.rb', line 72

def cooldown
  @cooldown
end

#descriptionString (readonly)

Returns:

  • (String)


54
55
56
# File 'lib/confctl/health_checks/run_command.rb', line 54

def description
  @description
end

#exit_statusInteger (readonly)

Returns:

  • (Integer)


60
61
62
# File 'lib/confctl/health_checks/run_command.rb', line 60

def exit_status
  @exit_status
end

#stderrOutput (readonly)

Returns:



66
67
68
# File 'lib/confctl/health_checks/run_command.rb', line 66

def stderr
  @stderr
end

#stdoutOutput (readonly)

Returns:



63
64
65
# File 'lib/confctl/health_checks/run_command.rb', line 63

def stdout
  @stdout
end

#timeoutInteger (readonly)

Returns:

  • (Integer)


69
70
71
# File 'lib/confctl/health_checks/run_command.rb', line 69

def timeout
  @timeout
end

Instance Method Details

#to_sObject



84
85
86
# File 'lib/confctl/health_checks/run_command.rb', line 84

def to_s
  @command.join(' ')
end