Class: MultiDelegator

Inherits:
Object
  • Object
show all
Defined in:
lib/openstudio/workflow/multi_delegator.rb

Overview

Class to allow multiple logging paths

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*targets) ⇒ MultiDelegator

Returns a new instance of MultiDelegator.



48
49
50
# File 'lib/openstudio/workflow/multi_delegator.rb', line 48

def initialize(*targets)
  @targets = targets
end

Class Method Details

.delegate(*methods) ⇒ Object



52
53
54
55
56
57
58
59
# File 'lib/openstudio/workflow/multi_delegator.rb', line 52

def self.delegate(*methods)
  methods.each do |m|
    define_method(m) do |*args|
      @targets.map { |t| t.send(m, *args) }
    end
  end
  self
end