Method: Quebert::AsyncSender::Promise#method_missing

Defined in:
lib/quebert/async_sender/promise.rb

#method_missing(meth, *args) ⇒ Object

Proxies the method call from async to the target, then tries to build a job with the targets ‘build_job` function.



16
17
18
19
20
21
22
23
24
# File 'lib/quebert/async_sender/promise.rb', line 16

def method_missing(meth, *args)
  if @target.respond_to? meth, true # The second `true` argument checks private methods.
    # Create an instance of the job through the proxy and 
    # configure it with the options given to the proxy.
    @block.call configure @target.build_job(meth, *args)
  else
    super
  end
end