Class: Neovim::Message Private

Inherits:
Object
  • Object
show all
Defined in:
lib/neovim/message.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: Notification, Request, Response

Class Method Summary collapse

Class Method Details

.from_array(kind, *payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/neovim/message.rb', line 6

def self.from_array((kind, *payload))
  case kind
  when 0
    request(*payload)
  when 1
    reqid, (_, error), value = payload
    response(reqid, error, value)
  when 2
    notification(*payload)
  else
    raise "Unknown message type #{kind.inspect}"
  end
end

.notification(method, args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


28
29
30
# File 'lib/neovim/message.rb', line 28

def self.notification(method, args)
  Notification.new(method, args)
end

.request(id, method, args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


20
21
22
# File 'lib/neovim/message.rb', line 20

def self.request(id, method, args)
  Request.new(id, method, args)
end

.response(request_id, error, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


24
25
26
# File 'lib/neovim/message.rb', line 24

def self.response(request_id, error, value)
  Response.new(request_id, error, value)
end