Module: AgentXmpp::Delegator

Defined in:
lib/agent_xmpp/main.rb

Overview


Class Method Summary collapse

Class Method Details

.delegate(del, *methods) ⇒ Object

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



158
159
160
161
162
163
164
165
166
# File 'lib/agent_xmpp/main.rb', line 158

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