Method: Farcall::Endpoint#on

Defined in:
lib/farcall/endpoint.rb

#on(name, &block) ⇒ Object

Set handler to perform the named command. Block will be called when the remote party calls with parameters passed from the remote. The block returned value will be passed back to the caller.

The provider if set is calling instead.

If the block raises the exception it will be reported to the caller as an error (depending on it’s platofrm, will raise exception on its end or report error)

[View source]

174
175
176
# File 'lib/farcall/endpoint.rb', line 174

def on(name, &block)
  @handlers[name.to_s] = block
end