Method: RubyApp::Mixins::RouteMixin#do_route

Defined in:
lib/ruby_app/mixins/route_mixin.rb

#do_route(method, path) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/ruby_app/mixins/route_mixin.rb', line 19

def do_route(method, path)
  self.routes.each do |route|
    if method == route[:method] and path =~ route[:pattern]
      return route[:block].call([method].concat($~.to_a))
    end
  end
end