Class: Angelo::Mustermann::RouteMap
- Inherits:
-
Object
- Object
- Angelo::Mustermann::RouteMap
- Defined in:
- lib/angelo/mustermann.rb
Instance Method Summary collapse
- #[](route) ⇒ Object
- #[]=(route, responder) ⇒ Object
-
#initialize ⇒ RouteMap
constructor
A new instance of RouteMap.
Constructor Details
#initialize ⇒ RouteMap
Returns a new instance of RouteMap.
57 58 59 |
# File 'lib/angelo/mustermann.rb', line 57 def initialize @hash = Hash.new end |
Instance Method Details
#[](route) ⇒ Object
65 66 67 68 69 70 71 72 |
# File 'lib/angelo/mustermann.rb', line 65 def [] route responder = nil if mustermann = @hash.keys.select {|k| k.match(route)}.first responder = @hash.fetch mustermann responder.mustermann = mustermann end responder end |
#[]=(route, responder) ⇒ Object
61 62 63 |
# File 'lib/angelo/mustermann.rb', line 61 def []= route, responder @hash[route] = responder end |