Class: Otis::Generator::RoutesPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/otis/generator/routes_presenter.rb

Instance Method Summary collapse

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

#endpointsObject



8
9
10
# File 'lib/otis/generator/routes_presenter.rb', line 8

def endpoints
  @routes.keys
end

#mapObject



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