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.
-
#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.
127 128 129 130 131 132 133 |
# File 'lib/spoom/sorbet/errors.rb', line 127 def initialize(file, line, , code, more = []) @file = file @line = line @message = @code = code @more = more end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
113 114 115 |
# File 'lib/spoom/sorbet/errors.rb', line 113 def code @code end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
110 111 112 |
# File 'lib/spoom/sorbet/errors.rb', line 110 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
113 114 115 |
# File 'lib/spoom/sorbet/errors.rb', line 113 def line @line end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
110 111 112 |
# File 'lib/spoom/sorbet/errors.rb', line 110 def @message end |
#more ⇒ Object (readonly)
Returns the value of attribute more.
116 117 118 |
# File 'lib/spoom/sorbet/errors.rb', line 116 def more @more end |
Instance Method Details
#<=>(other) ⇒ Object
137 138 139 140 |
# File 'lib/spoom/sorbet/errors.rb', line 137 def <=>(other) return 0 unless other.is_a?(Error) [file, line, code, ] <=> [other.file, other.line, other.code, other.] end |
#to_s ⇒ Object
143 144 145 |
# File 'lib/spoom/sorbet/errors.rb', line 143 def to_s "#{file}:#{line}: #{} (#{code})" end |