Class: Spoom::Sorbet::Errors::Error
- Inherits:
-
Object
- Object
- Spoom::Sorbet::Errors::Error
- Extended by:
- T::Sig
- Includes:
- Comparable
- Defined in:
- lib/spoom/sorbet/errors.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#files_from_error_sections ⇒ Object
readonly
Returns the value of attribute files_from_error_sections.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#more ⇒ Object
readonly
Returns the value of attribute more.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(file, line, message, code, more = []) ⇒ Error
constructor
A new instance of Error.
- #to_s ⇒ Object
Constructor Details
#initialize(file, line, message, code, more = []) ⇒ Error
Returns a new instance of Error.
151 152 153 154 155 156 157 158 |
# File 'lib/spoom/sorbet/errors.rb', line 151 def initialize(file, line, , code, more = []) @file = file @line = line @message = @code = code @more = more @files_from_error_sections = T.let(Set.new, T::Set[String]) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
133 134 135 |
# File 'lib/spoom/sorbet/errors.rb', line 133 def code @code end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
130 131 132 |
# File 'lib/spoom/sorbet/errors.rb', line 130 def file @file end |
#files_from_error_sections ⇒ Object (readonly)
Returns the value of attribute files_from_error_sections.
140 141 142 |
# File 'lib/spoom/sorbet/errors.rb', line 140 def files_from_error_sections @files_from_error_sections end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
133 134 135 |
# File 'lib/spoom/sorbet/errors.rb', line 133 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
130 131 132 |
# File 'lib/spoom/sorbet/errors.rb', line 130 def @message end |
#more ⇒ Object (readonly)
Returns the value of attribute more.
136 137 138 |
# File 'lib/spoom/sorbet/errors.rb', line 136 def more @more end |
Instance Method Details
#<=>(other) ⇒ Object
162 163 164 165 166 |
# File 'lib/spoom/sorbet/errors.rb', line 162 def <=>(other) return 0 unless other.is_a?(Error) [file, line, code, ] <=> [other.file, other.line, other.code, other.] end |
#to_s ⇒ Object
169 170 171 |
# File 'lib/spoom/sorbet/errors.rb', line 169 def to_s "#{file}:#{line}: #{} (#{code})" end |