Class: Newark::Router
- Inherits:
-
Object
- Object
- Newark::Router
- Defined in:
- lib/newark/router.rb
Instance Method Summary collapse
-
#initialize(routes, request) ⇒ Router
constructor
A new instance of Router.
- #route ⇒ Object
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
#route ⇒ Object
8 9 10 |
# File 'lib/newark/router.rb', line 8 def route @routes.find { |route| route.match?(@request) } end |