Method: Sinatra::Base.helpers

Defined in:
lib/sinatra/base.rb

.helpers(*extensions, &block) ⇒ Object

Makes the methods defined in the block and in the Modules given in extensions available to the handlers and templates

[View source]

1555
1556
1557
1558
# File 'lib/sinatra/base.rb', line 1555

def helpers(*extensions, &block)
  class_eval(&block)   if block_given?
  include(*extensions) if extensions.any?
end