Class: Class

Inherits:
Object show all
Defined in:
lib/motion/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#delegate(*args, &block) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/motion/core_ext.rb', line 27

def delegate(*args, &block)
  to = args.pop
  args.each do |method|
    send :define_method, method do |*args, &block|
      send(to).send(method, *args, &block)
    end
  end
end