Method: Neovim::RemoteModule::DSL#register_handler

Defined in:
lib/neovim/remote_module/dsl.rb

#register_handler(name, &block) ⇒ Object

Define an RPC handler for use in remote modules.

Parameters:

  • name (String)

    The handler name.

  • block (Proc)

    The body of the handler.


23
24
25
26
27
# File 'lib/neovim/remote_module/dsl.rb', line 23

def register_handler(name, &block)
  @handlers[name.to_s] = ::Proc.new do |client, *args|
    block.call(client, *args)
  end
end