Class: EacRubyUtils::Envs::ExecutionResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result, options) ⇒ ExecutionResult

Returns a new instance of ExecutionResult.



10
11
12
13
# File 'lib/eac_ruby_utils/envs/execution_result.rb', line 10

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/eac_ruby_utils/envs/execution_result.rb', line 8

def options
  @options
end

#rObject (readonly)

Returns the value of attribute r.



8
9
10
# File 'lib/eac_ruby_utils/envs/execution_result.rb', line 8

def r
  @r
end

Instance Method Details

#resultObject



15
16
17
18
19
20
# File 'lib/eac_ruby_utils/envs/execution_result.rb', line 15

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

  raise ::EacRubyUtils::Envs::ExecutionError, 'Failed!'
end

#success?Boolean

Returns:



22
23
24
# File 'lib/eac_ruby_utils/envs/execution_result.rb', line 22

def success?
  exit_code_zero? || expected_error?
end