Class: Sinatra::Application

Inherits:
Base
  • Object
show all
Defined in:
lib/sinatra/base.rb,
lib/sinatra/main.rb

Overview

Execution context for classic style (top-level) applications. All DSL methods executed on main are delegated to this class.

The Application class should not be subclassed, unless you want to inherit all settings, routes, handlers, and error pages from the top-level. Subclassing Sinatra::Base is heavily recommended for modular applications.

Constant Summary

Constants inherited from Base

Base::CALLERS_TO_IGNORE

Instance Attribute Summary

Attributes inherited from Base

#app, #env, #params, #request, #response, #template_cache

Class Method Summary collapse

Methods inherited from Base

add_filter, after, before, build, #call, call, #call!, caller_files, caller_locations, condition, configure, delete, development?, disable, enable, error, extensions, #forward, get, #halt, head, helpers, #initialize, inline_templates=, layout, middleware, mime_type, new, #new!, not_found, #pass, post, production?, prototype, put, quit!, reset!, run!, set, settings, #settings, template, test?, use

Methods included from Templates

#builder, #coffee, #erb, #erubis, #find_template, #haml, #less, #liquid, #markaby, #markdown, #nokogiri, #radius, #rdoc, #sass, #scss, #slim, #textile

Methods included from Helpers

#attachment, #back, #body, #cache_control, #content_type, #error, #etag, #expires, #headers, #last_modified, #mime_type, #not_found, #redirect, #send_file, #session, #status, #uri

Constructor Details

This class inherits a constructor from Sinatra::Base

Class Method Details

.register(*extensions, &block) ⇒ Object

:nodoc:



1428
1429
1430
1431
1432
# File 'lib/sinatra/base.rb', line 1428

def self.register(*extensions, &block) #:nodoc:
  added_methods = extensions.map {|m| m.public_instance_methods }.flatten
  Delegator.delegate(*added_methods)
  super(*extensions, &block)
end