Class: MilkTea::Linter::Warning
- Inherits:
-
Data
- Object
- Data
- MilkTea::Linter::Warning
- Defined in:
- lib/milk_tea/tooling/linter.rb
Overview
severity: :error | :warning | :hint
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#length ⇒ Object
readonly
Returns the value of attribute length.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#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.
-
#symbol_name ⇒ Object
readonly
Returns the value of attribute symbol_name.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) ⇒ Warning
constructor
A new instance of Warning.
- #to_diagnostic ⇒ Object
Constructor Details
#initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) ⇒ Warning
Returns a new instance of Warning.
108 |
# File 'lib/milk_tea/tooling/linter.rb', line 108 def initialize(path:, line:, column: nil, length: nil, code:, message:, severity: :warning, symbol_name: nil) = super |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def code @code end |
#column ⇒ Object (readonly)
Returns the value of attribute column
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def column @column end |
#length ⇒ Object (readonly)
Returns the value of attribute length
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def length @length end |
#line ⇒ Object (readonly)
Returns the value of attribute line
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def path @path end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def severity @severity end |
#symbol_name ⇒ Object (readonly)
Returns the value of attribute symbol_name
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def symbol_name @symbol_name end |
Instance Method Details
#as_json ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/milk_tea/tooling/linter.rb', line 114 def as_json(*) { path:, line:, column:, length:, code:, message:, severity: severity.to_s, symbol_name:, }.compact end |
#to_diagnostic ⇒ Object
110 111 112 |
# File 'lib/milk_tea/tooling/linter.rb', line 110 def to_diagnostic Diagnostic.new(path:, line:, column:, length:, code:, message:, severity:, symbol_name:) end |