Skip to content

Commit 55a1ab6

Browse files
Drakula2kTim Vandecasteele
authored andcommitted
Fixed support multiple API versions
1 parent 3ffd95d commit 55a1ab6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/grape-swagger.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def self.setup(options)
4646
}
4747
options = defaults.merge(options)
4848

49-
@@target_class = options[:target_class]
49+
target_class = options[:target_class]
5050
@@mount_path = options[:mount_path]
5151
@@class_name = options[:class_name] || options[:mount_path].gsub('/','')
5252
@@markdown = options[:markdown]
@@ -59,7 +59,7 @@ def self.setup(options)
5959
get @@mount_path do
6060
header['Access-Control-Allow-Origin'] = '*'
6161
header['Access-Control-Request-Method'] = '*'
62-
routes = @@target_class::combined_routes
62+
routes = target_class::combined_routes
6363

6464
if @@hide_documentation_path
6565
routes.reject!{ |route, value| "/#{route}/".index(parse_path(@@mount_path, nil) << '/') == 0 }
@@ -87,8 +87,8 @@ def self.setup(options)
8787
header['Access-Control-Allow-Origin'] = '*'
8888
header['Access-Control-Request-Method'] = '*'
8989
models = []
90-
routes = @@target_class::combined_routes[params[:name]]
91-
routes_array = routes.map { |route|
90+
routes = target_class::combined_routes[params[:name]]
91+
routes_array = routes.map {|route|
9292
next if route.route_hidden
9393
notes = route.route_notes && @@markdown ? Kramdown::Document.new(strip_heredoc(route.route_notes)).to_html : route.route_notes
9494
http_codes = parse_http_codes route.route_http_codes

0 commit comments

Comments
 (0)