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.
52 53 54 |
# File 'lib/angelo/mustermann.rb', line 52 def initialize @hash = Hash.new end |
Instance Method Details
#[](route) ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/angelo/mustermann.rb', line 60 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
56 57 58 |
# File 'lib/angelo/mustermann.rb', line 56 def []= route, responder @hash[route] = responder end |