Module: AgentXmpp::Delegator

Defined in:
lib/agent_xmpp/main.rb

Overview


Class Method Summary collapse

Class Method Details

.delegate(del, *methods) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….….….



99
100
101
102
103
104
105
106
107
# File 'lib/agent_xmpp/main.rb', line 99

def delegate(del, *methods)
  methods.each do |method_name|
    class_eval <<-RUBY
      def #{method_name.to_s}(*args, &blk)
        ::#{del}.send(#{method_name.inspect}, *args, &blk)
      end
    RUBY
  end
end