Class: GrapePathHelpers::RouteDisplayer
- Inherits:
-
Object
- Object
- GrapePathHelpers::RouteDisplayer
- Defined in:
- lib/grape-path-helpers/route_displayer.rb
Overview
class for displaying the path, helper method name, and required arguments for every Grape::Route.
Instance Method Summary collapse
Instance Method Details
#display ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/grape-path-helpers/route_displayer.rb', line 23 def display puts("== GRAPE ROUTE HELPERS ==\n\n") route_attributes.each do |attributes| puts("Verb: #{attributes[:route_method]}") puts("Path: #{attributes[:route_path]}") puts("Helper Method: #{attributes[:helper_names].join(', ')}") puts("Arguments: #{attributes[:helper_arguments].join(', ')}") puts("\n") end end |
#route_attributes ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/grape-path-helpers/route_displayer.rb', line 7 def route_attributes Grape::API::Instance .decorated_routes_by_helper_name .values .flatten .uniq .map do |route| { route_path: route.route_path, route_method: route.route_method, helper_names: route.helper_names, helper_arguments: route.helper_arguments } end end |