123456789_123456789_123456789_123456789_123456789_

Module: Sinatra

Relationships & Source Files
Namespace Children
Modules:
Classes:
Exceptions:
Defined in: lib/sinatra/base.rb,
lib/sinatra/indifferent_hash.rb,
lib/sinatra/main.rb,
lib/sinatra/show_exceptions.rb,
lib/sinatra/version.rb,
lib/sinatra/middleware/logger.rb,
sinatra-contrib/lib/sinatra/capture.rb,
sinatra-contrib/lib/sinatra/config_file.rb,
sinatra-contrib/lib/sinatra/content_for.rb,
sinatra-contrib/lib/sinatra/contrib.rb,
sinatra-contrib/lib/sinatra/cookies.rb,
sinatra-contrib/lib/sinatra/custom_logger.rb,
sinatra-contrib/lib/sinatra/engine_tracking.rb,
sinatra-contrib/lib/sinatra/extension.rb,
sinatra-contrib/lib/sinatra/haml_helpers.rb,
sinatra-contrib/lib/sinatra/json.rb,
sinatra-contrib/lib/sinatra/link_header.rb,
sinatra-contrib/lib/sinatra/multi_route.rb,
sinatra-contrib/lib/sinatra/namespace.rb,
sinatra-contrib/lib/sinatra/quiet_logger.rb,
sinatra-contrib/lib/sinatra/reloader.rb,
sinatra-contrib/lib/sinatra/required_params.rb,
sinatra-contrib/lib/sinatra/respond_with.rb,
sinatra-contrib/lib/sinatra/runner.rb,
sinatra-contrib/lib/sinatra/streaming.rb,
sinatra-contrib/lib/sinatra/test_helpers.rb,
sinatra-contrib/lib/sinatra/webdav.rb,
sinatra-contrib/lib/sinatra/contrib/setup.rb,
sinatra-contrib/lib/sinatra/contrib/version.rb

Constant Summary

Class Method Summary

Class Method Details

.helpers(*extensions, &block)

Include the helper modules provided in Sinatra's request context.

[ GitHub ]

  
# File 'lib/sinatra/base.rb', line 2159

def self.helpers(*extensions, &block)
  Delegator.target.helpers(*extensions, &block)
end

.new(base = Base, &block)

Create a new Sinatra application; the block is evaluated in the class scope.

[ GitHub ]

  
# File 'lib/sinatra/base.rb', line 2147

def self.new(base = Base, &block)
  base = Class.new(base)
  base.class_eval(&block) if block_given?
  base
end

.register(*extensions, &block)

Extend the top-level DSL with the modules provided.

[ GitHub ]

  
# File 'lib/sinatra/base.rb', line 2154

def self.register(*extensions, &block)
  Delegator.target.register(*extensions, &block)
end

.use(*args, &block)

Use the middleware for classic applications.

[ GitHub ]

  
# File 'lib/sinatra/base.rb', line 2164

def self.use(*args, &block)
  Delegator.target.use(*args, &block)
end