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.
105 |
# File 'lib/milk_tea/tooling/linter.rb', line 105 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
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def code @code end |
#column ⇒ Object (readonly)
Returns the value of attribute column
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def column @column end |
#length ⇒ Object (readonly)
Returns the value of attribute length
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def length @length end |
#line ⇒ Object (readonly)
Returns the value of attribute line
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def @message end |
#path ⇒ Object (readonly)
Returns the value of attribute path
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def path @path end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def severity @severity end |
#symbol_name ⇒ Object (readonly)
Returns the value of attribute symbol_name
104 105 106 |
# File 'lib/milk_tea/tooling/linter.rb', line 104 def symbol_name @symbol_name end |
Instance Method Details
#as_json ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/milk_tea/tooling/linter.rb', line 111 def as_json(*) { path:, line:, column:, length:, code:, message:, severity: severity.to_s, symbol_name:, }.compact end |
#to_diagnostic ⇒ Object
107 108 109 |
# File 'lib/milk_tea/tooling/linter.rb', line 107 def to_diagnostic Diagnostic.new(path:, line:, column:, length:, code:, message:, severity:, symbol_name:) end |