Class: Angelo::Base::RouteMap
- Inherits:
-
Object
- Object
- Angelo::Base::RouteMap
- Defined in:
- lib/angelo/base.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.
396 397 398 |
# File 'lib/angelo/base.rb', line 396 def initialize @hash = Hash.new end |
Instance Method Details
#[](route) ⇒ Object
404 405 406 407 408 409 410 411 |
# File 'lib/angelo/base.rb', line 404 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
400 401 402 |
# File 'lib/angelo/base.rb', line 400 def []= route, responder @hash[route] = responder end |