Module: Newark::App::ClassMethods

Defined in:
lib/newark/app.rb

Instance Method Summary collapse

Instance Method Details

#after(&block) ⇒ Object



41
42
43
44
# File 'lib/newark/app.rb', line 41

def after(&block)
  @after_hooks ||= []
  @after_hooks << block
end

#before(&block) ⇒ Object



36
37
38
39
# File 'lib/newark/app.rb', line 36

def before(&block)
  @before_hooks ||= []
  @before_hooks << block
end

#define_route(verb, path, constraints, handler) ⇒ Object



31
32
33
34
# File 'lib/newark/app.rb', line 31

def define_route(verb, path, constraints, handler)
  @routes[verb] ||= []
  @routes[verb] << Route.new(path, constraints, handler)
end