Class: GitLab::Monitor::CommandResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/gitlab_monitor/git.rb

Overview

Result of a command

Provides some handy methods for checking if the execution failed and a simple to_s that will return the command output

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



46
47
48
# File 'lib/gitlab_monitor/git.rb', line 46

def status
  @status
end

#stdoutObject

Returns the value of attribute stdout

Returns:

  • (Object)

    the current value of stdout



46
47
48
# File 'lib/gitlab_monitor/git.rb', line 46

def stdout
  @stdout
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


47
48
49
# File 'lib/gitlab_monitor/git.rb', line 47

def failed?
  status.nonzero?
end

#to_sObject



55
56
57
# File 'lib/gitlab_monitor/git.rb', line 55

def to_s
  stdout
end