Skip to content

Commit 57eb499

Browse files
arturoherreroTim Vandecasteele
authored andcommitted
Writting a little bit idiomatic Ruby code
1 parent 1ee9cc9 commit 57eb499

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/grape-swagger.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def self.setup(options)
6565
routes.reject!{ |route, value| "/#{route}/".index(parse_path(@@mount_path, nil) << '/') == 0 }
6666
end
6767

68-
routes_array = routes.keys.map do |local_route|
68+
routes_array = routes.keys.map { |local_route|
6969
next if routes[local_route].any? { |route| route.route_hidden }
7070
{ :path => "#{parse_path(route.route_path.gsub('(.:format)', ''),route.route_version)}/#{local_route}#{@@hide_format ? '' : '.{format}'}" }
71-
end.compact
71+
}.compact
7272

7373
{
7474
apiVersion: api_version,

spec/hide_api_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
class HideMountedApi < Grape::API
66
desc 'Show this endpoint'
77
get '/simple' do
8-
{ :bla => 'something' }
8+
{ :foo => 'bar' }
99
end
1010

1111
desc 'Hide this endpoint', {
1212
:hidden => true
1313
}
1414
get '/hide' do
15-
{ :bla => 'something_else' }
15+
{ :foo => 'bar' }
1616
end
1717
end
1818

0 commit comments

Comments
 (0)