class MultiDelegator

Constants

VERSION

Public Class Methods

new(*delegatees) click to toggle source
# File lib/multi_delegator.rb, line 4
def initialize(*delegatees)
  @delegatees = delegatees
end

Private Instance Methods

method_missing(meth, *a, &b) click to toggle source
Calls superclass method
# File lib/multi_delegator.rb, line 10
def method_missing(meth, *a, &b)
  super unless self.respond_to?(meth)
  @delegatees.map do |delegatee|
    delegatee.send(meth, *a, &b)
  end
end
respond_to_missing?(meth, incl_private=false) click to toggle source
Calls superclass method
# File lib/multi_delegator.rb, line 17
def respond_to_missing?(meth, incl_private=false)
  @delegatees.all? do |delegatee|
    delegatee.respond_to?(meth, incl_private)
  end || super
end