Skip to content

Commit 1c6a9dc

Browse files
committed
Replaces keyword args with opts
1 parent ffe147b commit 1c6a9dc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/grape/api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ def make_inheritable
4747
# For instance, a descripcion could be done using: `desc configuration[:description]` if it may vary
4848
# depending on where the endpoint is mounted. Use with care, if you find yourself using configuration
4949
# too much, you may actually want to provide a new API rather than remount it.
50-
def mount_instance(configuration: {})
50+
def mount_instance(opts = {})
5151
instance = Class.new(@base_parent)
52-
instance.instance_variable_set(:@configuration, configuration)
52+
instance.instance_variable_set(:@configuration, opts[:configuration] || {})
5353
instance.define_singleton_method(:configuration) { @configuration }
5454
replay_setup_on(instance)
5555
@instances << instance

lib/grape/dsl/routing.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ def do_not_route_options!
7777
namespace_inheritable(:do_not_route_options, true)
7878
end
7979

80-
def mount(mounts, with: {})
80+
def mount(mounts, opts = {})
8181
mounts = { mounts => '/' } unless mounts.respond_to?(:each_pair)
8282
mounts.each_pair do |app, path|
8383
if app.respond_to?(:mount_instance)
84-
return mount(app.mount_instance(configuration: with) => path)
84+
return mount(app.mount_instance(configuration: opts[:with] || {}) => path)
8585
end
8686
in_setting = inheritable_setting
8787

0 commit comments

Comments
 (0)