Class: RoadForest::Dispatcher::RouteMap::Configurator
- Inherits:
-
Object
- Object
- RoadForest::Dispatcher::RouteMap::Configurator
- Defined in:
- lib/roadforest/application/dispatcher.rb
Instance Method Summary collapse
- #from(name, params = nil) ⇒ Object
-
#initialize(name, router) ⇒ Configurator
constructor
A new instance of Configurator.
- #to(name) ⇒ Object
Constructor Details
#initialize(name, router) ⇒ Configurator
Returns a new instance of Configurator.
104 105 106 107 108 |
# File 'lib/roadforest/application/dispatcher.rb', line 104 def initialize(name, router) @router = router @map = RouteMap.new @map.in_name = name end |
Instance Method Details
#from(name, params = nil) ⇒ Object
110 111 112 113 114 |
# File 'lib/roadforest/application/dispatcher.rb', line 110 def from(name, params=nil) @map.from_name = name @map.from_params = [*params] self end |
#to(name) ⇒ Object
116 117 118 119 120 |
# File 'lib/roadforest/application/dispatcher.rb', line 116 def to(name) @map.to_name = name @router.add_route_map(@map) nil end |