Class: LanguageServer::Protocol::Interface::ResponseError
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ResponseError
- Defined in:
- lib/language_server/protocol/interface/response_error.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#code ⇒ number
A number indicating the error type that occurred.
-
#data ⇒ any
A primitive or structured value that contains additional information about the error.
-
#initialize(code:, message:, data: nil) ⇒ ResponseError
constructor
A new instance of ResponseError.
-
#message ⇒ string
A string providing a short description of the error.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(code:, message:, data: nil) ⇒ ResponseError
Returns a new instance of ResponseError.
5 6 7 8 9 10 11 12 13 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 5 def initialize(code:, message:, data: nil) @attributes = {} @attributes[:code] = code @attributes[:message] = @attributes[:data] = data if data @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
40 41 42 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 40 def attributes @attributes end |
Instance Method Details
#code ⇒ number
A number indicating the error type that occurred.
19 20 21 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 19 def code attributes.fetch(:code) end |
#data ⇒ any
A primitive or structured value that contains additional information about the error. Can be omitted.
36 37 38 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 36 def data attributes.fetch(:data) end |
#message ⇒ string
A string providing a short description of the error.
27 28 29 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 27 def attributes.fetch(:message) end |
#to_hash ⇒ Object
42 43 44 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 42 def to_hash attributes end |
#to_json(*args) ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/response_error.rb', line 46 def to_json(*args) to_hash.to_json(*args) end |