class Qpid::Proton::Handler::Adapter
Base adapter for raw proton events
Public Class Methods
adapt(handler)
click to toggle source
Create and return an adapter for handler, or return h if it does not need adapting.
# File lib/handler/adapter.rb, line 58 def self.adapt(handler) return unless handler a = Array(handler) h = (a.size == 1) ? a[0] : ArrayHandler.new(a) ac = adapter(h) ac ? ac.new(h) : h end
adapter(handler)
click to toggle source
Adapter
class if requested by handler, else default to MessagingHandler
# File lib/handler/adapter.rb, line 67 def self.adapter(handler) handler.respond_to?(:proton_adapter_class) ? handler.proton_adapter_class : MessagingAdapter end
new(h)
click to toggle source
# File lib/handler/adapter.rb, line 55 def initialize(h) @handler = h; end
Public Instance Methods
forward(method, *args)
click to toggle source
# File lib/handler/adapter.rb, line 73 def forward(method, *args) (@handler.__send__(method, *args); true) if @handler.respond_to? method end
proton_adapter_class()
click to toggle source
# File lib/handler/adapter.rb, line 71 def proton_adapter_class() nil; end