Class: Graphomaton::Diagnostic
- Inherits:
-
Data
- Object
- Data
- Graphomaton::Diagnostic
- Defined in:
- lib/graphomaton/model.rb,
sig/graphomaton.rbs
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#hint ⇒ Object
readonly
Returns the value of attribute hint.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Instance Method Summary collapse
-
#initialize(code:, severity:, path:, message:, hint: nil) ⇒ Diagnostic
constructor
A new instance of Diagnostic.
- #to_h ⇒ Hash[Symbol, untyped]
Constructor Details
#initialize(code:, severity:, path:, message:, hint: nil) ⇒ Diagnostic
Returns a new instance of Diagnostic.
180 181 182 183 184 185 186 187 188 |
# File 'lib/graphomaton/model.rb', line 180 def initialize(code:, severity:, path:, message:, hint: nil) super( code: ModelValue.copy(code.to_s), severity: severity.to_sym, path: ModelValue.copy(Array(path)), message: ModelValue.copy(.to_s), hint: hint.nil? ? nil : ModelValue.copy(hint.to_s) ) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
179 180 181 |
# File 'lib/graphomaton/model.rb', line 179 def code @code end |
#hint ⇒ Object (readonly)
Returns the value of attribute hint
179 180 181 |
# File 'lib/graphomaton/model.rb', line 179 def hint @hint end |
#message ⇒ Object (readonly)
Returns the value of attribute message
179 180 181 |
# File 'lib/graphomaton/model.rb', line 179 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
179 180 181 |
# File 'lib/graphomaton/model.rb', line 179 def path @path end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
179 180 181 |
# File 'lib/graphomaton/model.rb', line 179 def severity @severity end |
Instance Method Details
#to_h ⇒ Hash[Symbol, untyped]
190 191 192 |
# File 'lib/graphomaton/model.rb', line 190 def to_h { code: code, severity: severity, path: path, message: , hint: hint }.compact end |