Class: Kame::Remocon::Opal::Turtle::Forwarder

Inherits:
Object
  • Object
show all
Defined in:
lib/kame/remocon/opal/turtle.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj, *methods, &hook) ⇒ Forwarder

Returns a new instance of Forwarder.



53
54
55
56
57
58
59
60
# File 'lib/kame/remocon/opal/turtle.rb', line 53

def initialize(obj, *methods, &hook)
  methods.each do |name|
    define_singleton_method(name) do |*args|
      obj.method(name).call(*args)
      hook.call
    end
  end
end