class Qpid::Proton::Handler::ArrayHandler

Handler for an array of handlers of uniform type, with non-conflicting options

Attributes

options[R]
proton_adapter_class[R]

Public Class Methods

new(handlers) click to toggle source
# File lib/handler/adapter.rb, line 28
def initialize(handlers)
  raise "empty handler array" if handlers.empty?
  adapters = (handlers.map { |h| Adapter.adapter(h) }).uniq
  raise "handler array not uniform, adapters requested: #{adapters}" if adapters.size > 1
  @proton_adapter_class = adapters[0]
  @methods = Set.new
  handlers.each do |h|
    @methods.merge(h.methods.select { |m| handler_method? m }) # Collect handler methods
  end
end

Public Instance Methods

method_missing(name, *args) click to toggle source
Calls superclass method
# File lib/handler/adapter.rb, line 41
def method_missing(name, *args)
  if respond_to_missing?(name)
    @adapters.each { |a| a.__send__(name, *args) if a.respond_to? name}
  else
    super
  end
end
respond_to?(name, all=false) click to toggle source
Calls superclass method
# File lib/handler/adapter.rb, line 50
def respond_to?(name, all=false) super || respond_to_missing?(name); end
respond_to_missing?(name, private=false) click to toggle source
# File lib/handler/adapter.rb, line 49
def respond_to_missing?(name, private=false); @methods.include?(name); end