Sha256: c85e18cc7a2ff74ebc97a5bb4f8ed93d9bc5ade3e7f0b0308e8a74173d75b57f
Contents?: true
Size: 943 Bytes
Versions: 5
Compression:
Stored size: 943 Bytes
Contents
module GrapeRouteHelpers # class for displaying the path, helper method name, # and required arguments for every Grape::Route. class RouteDisplayer def route_attributes Grape::API.decorated_routes.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 def display puts("== GRAPE ROUTE HELPERS ==\n\n") route_attributes.each do |attributes| printf("%s: %s\n", 'Verb', attributes[:route_method]) printf("%s: %s\n", 'Path', attributes[:route_path]) printf("%s: %s\n", 'Helper Method', attributes[:helper_names].join(', ')) printf("%s: %s\n", 'Arguments', attributes[:helper_arguments].join(', ')) puts("\n") end end end end
Version data entries
5 entries across 5 versions & 1 rubygems