Class: Shaf::ApiRoutes::Registry
- Inherits:
-
Object
- Object
- Shaf::ApiRoutes::Registry
- Defined in:
- lib/shaf/extensions/api_routes.rb
Class Method Summary collapse
- .controllers ⇒ Object
- .register(controller, method, symbol) ⇒ Object
- .routes_for(controller) ⇒ Object
Class Method Details
.controllers ⇒ Object
11 12 13 |
# File 'lib/shaf/extensions/api_routes.rb', line 11 def controllers routes.keys.sort_by(&:to_s) end |
.register(controller, method, symbol) ⇒ Object
7 8 9 |
# File 'lib/shaf/extensions/api_routes.rb', line 7 def register(controller, method, symbol) routes[controller][symbol] << method.to_s.upcase end |
.routes_for(controller) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/shaf/extensions/api_routes.rb', line 15 def routes_for(controller) sorted = routes[controller].keys.sort_by(&:to_s) sorted.each do |symbol| yield route_info(controller, symbol) end end |