summaryrefslogtreecommitdiff
path: root/lib/web/route_registry.rb
blob: f53c88582e7499206b40f47025a8525d18a29b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require 'routed_command'
require 'block_specification'

module Booty
  class RouteRegistry
    def initialize(routes = [])
      @routes = routes
    end

    def register(route)
      @routes.push(route)
    end

    def route_for(request)
      @routes.find { |route| route.matches?(request) }
    end
  end
end