Class: Sinatra::Helpers::Stream::Base

### Home Classes Methods

### In Files

- lib/sinatra/base.rb

### Parent

Object

### Methods

- ::new
- ::settings
- #call
- #forward
- #halt
- #options
- #pass
- #settings

### Included Modules

- Rack::Utils
- Sinatra::Helpers
- Sinatra::Helpers::Stream::Templates

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Sinatra
- Sinatra::Application
- Sinatra::CommonLogger
- Sinatra::ExtendedRack
- Sinatra::Helpers
- Sinatra::Helpers::Stream
- Sinatra::Helpers::Stream::Application
- Sinatra::Helpers::Stream::Base
- Sinatra::Helpers::Stream::Templates
- Sinatra::Helpers::Stream::Templates::ContentTyped
- Sinatra::Helpers::Stream::Wrapper
- Sinatra::Request
- Sinatra::Request::AcceptEntry
- Sinatra::Response
- Sinatra::ShowExceptions
- Rack
- Rack::Builder

No matching classes.

# Sinatra::Helpers::Stream::Base

Base class for all Sinatra applications and middleware.

### Constants

CALLERS_TO_IGNORE
URI_INSTANCE

### Attributes

app[RW]
env[RW]
params[RW]
request[RW]
response[RW]
template_cache[R]

### Public Class Methods

new(app = nil) click to toggle source

    # File lib/sinatra/base.rb, line 868
    def initialize(app = nil)
      super()
      @app = app
      @template_cache = Tilt::Cache.new
      yield self if block_given?
    end

Also aliased as: new!
settings() click to toggle source

Access settings defined with Base.set.

    # File lib/sinatra/base.rb, line 904
    def self.settings
      self
    end

### Public Instance Methods

call(env) click to toggle source

Rack call interface.

    # File lib/sinatra/base.rb, line 876
    def call(env)
      dup.call!(env)
    end

forward() click to toggle source

Forward the request to the downstream app – middleware only.

    # File lib/sinatra/base.rb, line 934
    def forward
      fail "downstream app not set" unless @app.respond_to? :call
      status, headers, body = @app.call env
      @response.status = status
      @response.body = body
      @response.headers.merge! headers
      nil
    end

halt(*response) click to toggle source

Exit the current block, halts any further processing of the request, and returns the specified response.

    # File lib/sinatra/base.rb, line 921
    def halt(*response)
      response = response.first if response.length == 1
      throw :halt, response
    end

options() click to toggle source

    # File lib/sinatra/base.rb, line 913
    def options
      warn "Sinatra::Base#options is deprecated and will be removed, "          "use #settings instead."
      settings
    end

pass(&block) click to toggle source

Pass control to the next matching route. If there are no more matching routes, Sinatra will return a 404 response.

    # File lib/sinatra/base.rb, line 929
    def pass(&block)
      throw :pass, block
    end

settings() click to toggle source

Access settings defined with Base.set.

    # File lib/sinatra/base.rb, line 909
    def settings
      self.class.settings
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.