Class: Canson::RouteMap
- Inherits:
-
Object
- Object
- Canson::RouteMap
- Defined in:
- lib/canson/route_map.rb
Overview
keeps routes and responders
Instance Method Summary collapse
- #[](route) ⇒ Object
- #[]=(route, responder) ⇒ Object
-
#initialize ⇒ RouteMap
constructor
A new instance of RouteMap.
Constructor Details
#initialize ⇒ RouteMap
6 7 8 |
# File 'lib/canson/route_map.rb', line 6 def initialize @hash = {} end |
Instance Method Details
#[](route) ⇒ Object
14 15 16 17 |
# File 'lib/canson/route_map.rb', line 14 def [](route) _path, responder = @hash.find { |k, _v| k.match(route) } responder end |
#[]=(route, responder) ⇒ Object
10 11 12 |
# File 'lib/canson/route_map.rb', line 10 def []=(route, responder) @hash[route] = responder end |