Skip to content

Commit

Permalink
Step 4: Being able to halt from callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl Lerche committed Aug 27, 2009
1 parent d85579f commit d08f1b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sinatrails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
module Sinatra
class Base < ActionController::Metal
include ActionController::RackConvenience
include AbstractController::Callbacks

class << self
# Set @_routes on child classes
def inherited(klass)
klass.class_eval { @_routes = [] }
end

# Sinatra uses the before keyword instead of
# before_filter, so let's alias the two.
alias before before_filter

# A helper method that provides a nice API
# for setting arbitrary settings
def set(name, value)
Expand Down

0 comments on commit d08f1b4

Please sign in to comment.