module Artoo::Delegator
Artoo
delegation mixin that acts like Sinatra. Mixing this module into an object causes all methods to be delegated to the Artoo::MainRobot
class. Used primarily at the top-level.
Attributes
target[RW]
Public Class Methods
delegate(*methods)
click to toggle source
Calls superclass method
# File lib/artoo/delegator.rb, line 13 def self.delegate(*methods) methods.each do |method_name| define_method(method_name) do |*args, &block| return super(*args, &block) if respond_to? method_name Delegator.target.send(method_name, *args, &block) end private method_name end end