Class: Yast::LogGroupResult

Inherits:
Object
  • Object
show all
Defined in:
src/ruby/yast/y2logger.rb

Overview

Stores the log group result data, used in Y2Logger#group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogGroupResult

Returns a new instance of LogGroupResult.



35
36
37
38
39
# File 'src/ruby/yast/y2logger.rb', line 35

def initialize
  # these return values are considered failures by default,
  # can be overridden by modifying the `error_values` list
  @error_values = [:abort, :cancel, false]
end

Instance Attribute Details

#error_valuesArray

Returns list of error values (result values that will make success false).

Returns:

  • (Array)

    list of error values (result values that will make success false)



23
24
25
# File 'src/ruby/yast/y2logger.rb', line 23

def error_values
  @error_values
end

#resultObject

Returns result of the block.

Returns:

  • (Object)

    result of the block



16
17
18
# File 'src/ruby/yast/y2logger.rb', line 16

def result
  @result
end

#success=(value) ⇒ Object

Parameters:

  • value (Boolean)

    set to false if the result of the group is a failure, overrides the state evaluated from the the #result attribute



20
21
22
# File 'src/ruby/yast/y2logger.rb', line 20

def success=(value)
  @success = value
end

#summaryString?

Returns result of the step as a textual description.

Returns:

  • (String, nil)

    result of the step as a textual description



13
14
15
# File 'src/ruby/yast/y2logger.rb', line 13

def summary
  @summary
end

Instance Method Details

#success?Boolean

was the execution of the block successful?

Returns:

  • (Boolean)

    true if the block succeeded, false otherwise



27
28
29
30
31
32
33
# File 'src/ruby/yast/y2logger.rb', line 27

def success?
  if success.nil?
    !error_values.include?(result)
  else
    success
  end
end