Class: Rack::Mount::RouteSet

Inherits:
Object
  • Object
show all
Defined in:
lib/tentd/api/router.rb

Instance Method Summary collapse

Instance Method Details

#merge_route(route) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/tentd/api/router.rb', line 10

def merge_route(route)
  @routes << route

  @recognition_key_analyzer << route.conditions

  @named_routes[route.name] = route if route.name
  @generation_route_keys << route.generation_keys

  expire!
  route
end

#merge_routes(routes) ⇒ Object



5
6
7
8
# File 'lib/tentd/api/router.rb', line 5

def merge_routes(routes)
  routes.each { |r| merge_route(r) }
  rehash
end