module Sinatra::Conditions

Public Class Methods

included(app) click to toggle source
# File lib/sinatra/conditions.rb, line 6
def self.included(app)
        app.register self
end
registered(app) click to toggle source
# File lib/sinatra/conditions.rb, line 10
def self.registered(app)

        ## For method condition
        ## Example: `before '/', :method => :post do`
        app.set(:method) do |method|
                method = method.to_s.upcase
                condition { request.request_method == method }
        end

end