Parent

Files

Class/Module Index [+]

Quicksearch

Grape::API

Attributes

combined_routes[R]

Public Class Methods

add_swagger_documentation(options={}) click to toggle source
# File lib/grape-swagger.rb, line 8
def add_swagger_documentation(options={})
  documentation_class = create_documentation_class

  documentation_class.setup({:target_class => self}.merge(options))
  mount(documentation_class)

  @combined_routes = {}

  routes.each do |route|
    route_match = route.route_path.split(route.route_prefix).last.match('\/([\w|-]*?)[\.\/\(]')
    next if route_match.nil?
    resource = route_match.captures.first
    next if resource.empty?
    resource.downcase!

    @combined_routes[resource] ||= []

    unless @@hide_documentation_path and route.route_path.include?(@@mount_path)
      @combined_routes[resource] << route
    end
  end

end

[Validate]

Generated with the Darkfish Rdoc Generator 2.