Class: TypeProf::LSP::Writer
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Inherits: | Object |
Defined in: | lib/typeprof/lsp.rb |
Class Method Summary
- .new(io) ⇒ Writer constructor
Instance Method Summary
Constructor Details
.new(io) ⇒ Writer
# File 'lib/typeprof/lsp.rb', line 801
def initialize(io) @io = io end
Instance Method Details
#write(**json)
[ GitHub ]# File 'lib/typeprof/lsp.rb', line 805
def write(**json) json = JSON.generate(json.merge(jsonrpc: "2.0")) @io << "Content-Length: #{ json.bytesize }\r\n\r\n" << json @io.flush end