Class: Rack::App::Worker::ClientProxy::Wrapper

Inherits:
BasicObject
Defined in:
lib/rack/app/worker/client_proxy/wrapper.rb

Instance Method Summary collapse

Constructor Details

#initialize(exchange) ⇒ Wrapper



4
5
6
# File 'lib/rack/app/worker/client_proxy/wrapper.rb', line 4

def initialize(exchange)
  @exchange = exchange
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (protected)



10
11
12
13
14
# File 'lib/rack/app/worker/client_proxy/wrapper.rb', line 10

def method_missing(method_name, *args)
  headers = {'method_name' => method_name.to_s}
  @exchange.publish(::YAML.dump(args), :headers => headers)
  nil
end