Module: Zgomot::Delegator

Defined in:
lib/zgomot/main.rb

Class Method Summary collapse

Class Method Details

.delegate(del, *methods) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/zgomot/main.rb', line 4

def delegate(del, *methods)
  methods.each do |method_name|
    class_eval <<-RUBY
      def #{method_name.to_s}(*args, &blk)
        ::#{del}.send(#{method_name.inspect}, *args, &blk)
      end
    RUBY
  end
end