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
275 276 277 278 279 280 281 282 283 |
# File 'lib/bot_nyan/base.rb', line 275 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 |