Class: Chaplin::Parser::Router
- Inherits:
-
Object
- Object
- Chaplin::Parser::Router
- Defined in:
- lib/chaplin/parser/router.rb
Instance Method Summary collapse
-
#initialize(routes_declarations, pages, redirects) ⇒ Router
constructor
A new instance of Router.
- #routes ⇒ Object
Constructor Details
#initialize(routes_declarations, pages, redirects) ⇒ Router
Returns a new instance of Router.
10 11 12 13 14 |
# File 'lib/chaplin/parser/router.rb', line 10 def initialize(routes_declarations, pages, redirects) @routes_declarations = routes_declarations @pages = pages @redirects = redirects end |
Instance Method Details
#routes ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/chaplin/parser/router.rb', line 16 def routes {}.tap do |routes| @routes_declarations.each do |endpoint, response_name| routes[build_endpoint(endpoint)] = response(response_name) end end end |