Class: Neovim::Session::API::Function Private

Inherits:
Object
  • Object
show all
Defined in:
lib/neovim/session/api.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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, async) ⇒ Function

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.

Returns a new instance of Function.



51
52
53
# File 'lib/neovim/session/api.rb', line 51

def initialize(name, async)
  @name, @async = name, async
end

Instance Attribute Details

#asyncObject (readonly)

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.



49
50
51
# File 'lib/neovim/session/api.rb', line 49

def async
  @async
end

#nameObject (readonly)

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.



49
50
51
# File 'lib/neovim/session/api.rb', line 49

def name
  @name
end

Instance Method Details

#call(session, *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.

Apply this function to a running RPC session. Sends either a request if async is false or a notification if async is true.



57
58
59
60
61
62
63
# File 'lib/neovim/session/api.rb', line 57

def call(session, *args)
  if async
    session.notify(name, *args)
  else
    session.request(name, *args)
  end
end