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.
153 154 155 156 157 158 159 160 |
# File 'lib/spoom/sorbet/errors.rb', line 153 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.
135 136 137 |
# File 'lib/spoom/sorbet/errors.rb', line 135 def code @code end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
132 133 134 |
# File 'lib/spoom/sorbet/errors.rb', line 132 def file @file end |
#files_from_error_sections ⇒ Object (readonly)
Returns the value of attribute files_from_error_sections.
142 143 144 |
# File 'lib/spoom/sorbet/errors.rb', line 142 def files_from_error_sections @files_from_error_sections end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
135 136 137 |
# File 'lib/spoom/sorbet/errors.rb', line 135 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
132 133 134 |
# File 'lib/spoom/sorbet/errors.rb', line 132 def @message end |
#more ⇒ Object (readonly)
Returns the value of attribute more.
138 139 140 |
# File 'lib/spoom/sorbet/errors.rb', line 138 def more @more end |
Instance Method Details
#<=>(other) ⇒ Object
164 165 166 167 168 |
# File 'lib/spoom/sorbet/errors.rb', line 164 def <=>(other) return 0 unless other.is_a?(Error) [file, line, code, ] <=> [other.file, other.line, other.code, other.] end |
#to_s ⇒ Object
171 172 173 |
# File 'lib/spoom/sorbet/errors.rb', line 171 def to_s "#{file}:#{line}: #{} (#{code})" end |