Module: BotNyan::Delegator

Defined in:
lib/bot_nyan/base.rb

Overview

Delegator module it delegate some DSL methods to main Object

Class Method Summary collapse

Class Method Details

.delegate(*methods) ⇒ Object



286
287
288
289
290
291
292
293
294
# File 'lib/bot_nyan/base.rb', line 286

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
    Bot.send(method_name, *args, &block)
    end
    private method_name
  end
end