Class: Cuprum::Utils::ResultNotEmptyWarning
- Inherits:
-
Object
- Object
- Cuprum::Utils::ResultNotEmptyWarning
- Defined in:
- lib/cuprum/utils/result_not_empty_warning.rb
Overview
Helper class for building a warning message when a command returns a result, but the command’s current result already has errors, a set status, or is halted.
Instance Method Summary collapse
-
#initialize(result) ⇒ ResultNotEmptyWarning
constructor
A new instance of ResultNotEmptyWarning.
-
#message ⇒ String
The warning message for the given result.
-
#warning? ⇒ Boolean
True if a warning is generated, otherwise false.
Constructor Details
#initialize(result) ⇒ ResultNotEmptyWarning
Returns a new instance of ResultNotEmptyWarning.
13 14 15 |
# File 'lib/cuprum/utils/result_not_empty_warning.rb', line 13 def initialize result @result = result end |
Instance Method Details
#message ⇒ String
Returns The warning message for the given result.
18 19 20 21 22 |
# File 'lib/cuprum/utils/result_not_empty_warning.rb', line 18 def return ''.freeze if warnings.empty? MESSAGE + humanize_list(warnings).freeze end |
#warning? ⇒ Boolean
Returns True if a warning is generated, otherwise false.
25 26 27 |
# File 'lib/cuprum/utils/result_not_empty_warning.rb', line 25 def warning? !warnings.empty? end |