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.
83 84 85 |
# File 'lib/angelo/mustermann.rb', line 83 def initialize @hash = Hash.new end |
Instance Method Details
#[](route) ⇒ Object
91 92 93 94 95 96 97 98 |
# File 'lib/angelo/mustermann.rb', line 91 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
87 88 89 |
# File 'lib/angelo/mustermann.rb', line 87 def []= route, responder @hash[route] = responder end |