Ruby test

Ruby code posted by me
created at 05 Jun 10:17

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class UltimateProxy < BasicObject
  def initialize(object)
    delegate_everything_to(object)
  end

  private

  def delegate_everything_to(object)
    metaclass = class << self; self; end
    metaclass.__send__(:define_method, :method_missing) do |message, *args|
      object.__send__ message, *args
    end
  end
end
333 Bytes in 2 ms with coderay