Class: Beetle::Client::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/beetle/client.rb

Overview

:nodoc:all

Instance Method Summary collapse

Constructor Details

#initialize(client, options = {}) ⇒ Configurator

Returns a new instance of Configurator.



360
361
362
363
# File 'lib/beetle/client.rb', line 360

def initialize(client, options={})
  @client = client
  @options = options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



364
365
366
367
368
# File 'lib/beetle/client.rb', line 364

def method_missing(method, *args, &block)
  super unless %w(exchange queue binding message handler).include?(method.to_s)
  options = @options.merge(args.last.is_a?(Hash) ? args.pop : {})
  @client.send("register_#{method}", *(args+[options]), &block)
end

Instance Method Details

#binding(*args, &block) ⇒ Object

need to override binding explicitely



370
371
372
# File 'lib/beetle/client.rb', line 370

def binding(*args, &block)
  method_missing(:binding, *args, &block)
end