Class: EacRubyUtils::Envs::Command::ExecuteResult

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/envs/command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, options) ⇒ ExecuteResult

Returns a new instance of ExecuteResult.


133
134
135
136
# File 'lib/eac_ruby_utils/envs/command.rb', line 133

def initialize(result, options)
  @r = result
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options


131
132
133
# File 'lib/eac_ruby_utils/envs/command.rb', line 131

def options
  @options
end

#rObject (readonly)

Returns the value of attribute r


131
132
133
# File 'lib/eac_ruby_utils/envs/command.rb', line 131

def r
  @r
end

Instance Method Details

#resultObject


138
139
140
141
142
143
# File 'lib/eac_ruby_utils/envs/command.rb', line 138

def result
  return exit_code_zero_result if exit_code_zero?
  return expected_error_result if expected_error?

  raise 'Failed!'
end

#success?Boolean

Returns:


145
146
147
# File 'lib/eac_ruby_utils/envs/command.rb', line 145

def success?
  exit_code_zero? || expected_error?
end