Class: Newark::Router

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

Instance Method Summary collapse

Constructor Details

#initialize(routes, request) ⇒ Router

Returns a new instance of Router.



4
5
6
# File 'lib/newark/router.rb', line 4

def initialize(routes, request)
  @routes, @request = routes, request
end

Instance Method Details

#routeObject



8
9
10
# File 'lib/newark/router.rb', line 8

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