Module: Sinatra::Delegator

Defined in:
lib/sinatra/base.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.delegate(*methods) ⇒ Object



980
981
982
983
984
985
986
987
988
989
# File 'lib/sinatra/base.rb', line 980

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