class EmFarcall::Interface
Interface
to the remote provider via Farcall
protocols. Works the same as if the object is local and yields block in return, unlike Farcall::Interface
that blocks
RemoteInterface transparently creates methods as you call them to speedup subsequent calls.
Public Class Methods
new(endpoint)
click to toggle source
Create interface to the endpoint.
@param endpoint [Farcall::Endpoint] to connect to.
# File lib/farcall/em_farcall.rb, line 231 def initialize(endpoint) @endpoint = endpoint end
Public Instance Methods
method_missing(method_name, *arguments, **kw_arguments, &block)
click to toggle source
# File lib/farcall/em_farcall.rb, line 235 def method_missing(method_name, *arguments, **kw_arguments, &block) instance_eval <<-End def #{method_name} *arguments, **kw_arguments, &block @endpoint.call '#{method_name}', *arguments, **kw_arguments, &block end End @endpoint.call method_name, *arguments, **kw_arguments, &block end
respond_to_missing?(method_name, include_private = false)
click to toggle source
# File lib/farcall/em_farcall.rb, line 244 def respond_to_missing?(method_name, include_private = false) true end