Module: Sinatra
- Defined in:
- lib/sinatra/base.rb,
lib/sinatra/main.rb,
lib/sinatra/version.rb,
lib/sinatra/show_exceptions.rb,
lib/sinatra/indifferent_hash.rb,
lib/sinatra/middleware/logger.rb
Defined Under Namespace
Modules: Delegator, Helpers, Middleware, Templates Classes: Application, BadRequest, Base, CommonLogger, Error, ExtendedRack, IndifferentHash, NotFound, Request, Response, ShowExceptions, TemplateCache, Wrapper
Constant Summary collapse
- PARAMS_CONFIG =
{}
- VERSION =
'4.1.1'
Class Method Summary collapse
-
.helpers(*extensions, &block) ⇒ Object
Include the helper modules provided in Sinatra's request context.
-
.new(base = Base, &block) ⇒ Object
Create a new Sinatra application; the block is evaluated in the class scope.
-
.register(*extensions, &block) ⇒ Object
Extend the top-level DSL with the modules provided.
-
.use(*args, &block) ⇒ Object
Use the middleware for classic applications.
Class Method Details
.helpers(*extensions, &block) ⇒ Object
Include the helper modules provided in Sinatra's request context.
2159 2160 2161 |
# File 'lib/sinatra/base.rb', line 2159 def self.helpers(*extensions, &block) Delegator.target.helpers(*extensions, &block) end |
.new(base = Base, &block) ⇒ Object
Create a new Sinatra application; the block is evaluated in the class scope.
2147 2148 2149 2150 2151 |
# 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 |