Module: Sipatra::Delegator

Defined in:
lib/sipatra/base.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.delegate(*methods) ⇒ Object



276
277
278
279
280
281
282
283
284
285
# File 'lib/sipatra/base.rb', line 276

def self.delegate(*methods)
  methods.each do |method_name|
    eval <<-RUBY, binding, '(__DELEGATE__)', 1
      def #{method_name}(*args, &b)
        ::Sipatra::Application.send(#{method_name.inspect}, *args, &b)
      end
      private #{method_name.inspect}
    RUBY
  end
end