Class: Y2Issues::Issue
- Inherits:
-
Object
- Object
- Y2Issues::Issue
- Includes:
- Yast::I18n
- Defined in:
- library/general/src/lib/y2issues/issue.rb
Overview
Represents a problem detected by YaST.
This class represents a generic error. Other classes can inherit from this one to add more specific information. See InvalidValue as an example.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#location ⇒ Location?
readonly
Where the error is located.
-
#message ⇒ String
readonly
Error message.
-
#severity ⇒ Symbol
readonly
Error severity (:warn, :error).
Instance Method Summary collapse
-
#error? ⇒ Boolean
(also: #fatal?)
Determines whether the issue is an error.
-
#initialize(message, location: nil, severity: :warn) ⇒ Issue
constructor
A new instance of Issue.
Constructor Details
#initialize(message, location: nil, severity: :warn) ⇒ Issue
Returns a new instance of Issue.
53 54 55 56 57 |
# File 'library/general/src/lib/y2issues/issue.rb', line 53 def initialize(, location: nil, severity: :warn) @message = @location = location.is_a?(String) ? Location.parse(location) : location @severity = severity end |
Instance Attribute Details
#location ⇒ Location? (readonly)
Returns Where the error is located.
42 43 44 |
# File 'library/general/src/lib/y2issues/issue.rb', line 42 def location @location end |
#message ⇒ String (readonly)
Returns Error message.
44 45 46 |
# File 'library/general/src/lib/y2issues/issue.rb', line 44 def @message end |
#severity ⇒ Symbol (readonly)
Returns Error severity (:warn, :error).
46 47 48 |
# File 'library/general/src/lib/y2issues/issue.rb', line 46 def severity @severity end |
Instance Method Details
#error? ⇒ Boolean Also known as: fatal?
Determines whether the issue is an error
62 63 64 |
# File 'library/general/src/lib/y2issues/issue.rb', line 62 def error? @severity == :error end |