Class: Holistic::LanguageServer::Response::Error
- Inherits:
-
Data
- Object
- Data
- Holistic::LanguageServer::Response::Error
- Defined in:
- lib/holistic/language_server/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
Instance Method Summary collapse
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
19 20 21 |
# File 'lib/holistic/language_server/response.rb', line 19 def code @code end |
#data ⇒ Object (readonly)
Returns the value of attribute data
19 20 21 |
# File 'lib/holistic/language_server/response.rb', line 19 def data @data end |
#message ⇒ Object (readonly)
Returns the value of attribute message
19 20 21 |
# File 'lib/holistic/language_server/response.rb', line 19 def @message end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id
19 20 21 |
# File 'lib/holistic/language_server/response.rb', line 19 def @message_id end |
Instance Method Details
#encode ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/holistic/language_server/response.rb', line 20 def encode encoded_payload = { "jsonrpc" => Protocol::JSONRPC_VERSION, "id" => , "error" => { "code" => code, "message" => , "data" => data } }.to_json "#{Protocol::CONTENT_LENGTH_HEADER}:#{encoded_payload.bytesize}#{Protocol::END_OF_HEADER}#{encoded_payload}" end |