Class: RubyLsp::Error
- Inherits:
-
Object
- Object
- RubyLsp::Error
- Defined in:
- lib/ruby_lsp/utils.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
: Integer.
-
#message ⇒ Object
readonly
: String.
Instance Method Summary collapse
-
#initialize(id:, code:, message:, data: nil) ⇒ Error
constructor
: (id: Integer, code: Integer, message: String, ?data: Hash[Symbol, untyped]?) -> void.
-
#to_hash ⇒ Object
: -> Hash[Symbol, untyped].
Constructor Details
#initialize(id:, code:, message:, data: nil) ⇒ Error
: (id: Integer, code: Integer, message: String, ?data: Hash[Symbol, untyped]?) -> void
208 209 210 211 212 213 |
# File 'lib/ruby_lsp/utils.rb', line 208 def initialize(id:, code:, message:, data: nil) @id = id @code = code = @data = data end |
Instance Attribute Details
#code ⇒ Object (readonly)
: Integer
205 206 207 |
# File 'lib/ruby_lsp/utils.rb', line 205 def code @code end |
#message ⇒ Object (readonly)
: String
202 203 204 |
# File 'lib/ruby_lsp/utils.rb', line 202 def end |
Instance Method Details
#to_hash ⇒ Object
: -> Hash[Symbol, untyped]
216 217 218 219 220 221 222 223 224 225 |
# File 'lib/ruby_lsp/utils.rb', line 216 def to_hash { id: @id, error: { code: @code, message: , data: @data, }, } end |