Class: Otis::Generator::RoutesPresenter
- Inherits:
-
Object
- Object
- Otis::Generator::RoutesPresenter
- Defined in:
- lib/otis/generator/routes_presenter.rb
Instance Method Summary collapse
- #endpoints ⇒ Object
-
#initialize(routes) ⇒ RoutesPresenter
constructor
A new instance of RoutesPresenter.
- #map ⇒ Object
Constructor Details
#initialize(routes) ⇒ RoutesPresenter
Returns a new instance of RoutesPresenter.
4 5 6 |
# File 'lib/otis/generator/routes_presenter.rb', line 4 def initialize(routes) @routes = routes end |
Instance Method Details
#endpoints ⇒ Object
8 9 10 |
# File 'lib/otis/generator/routes_presenter.rb', line 8 def endpoints @routes.keys end |
#map ⇒ Object
12 13 14 15 16 |
# File 'lib/otis/generator/routes_presenter.rb', line 12 def map s = '' @routes.each_pair { |route, klass| s << ":#{route} => #{klass},\n" } s end |