lib/grape/api.rb in grape-1.4.0 vs lib/grape/api.rb in grape-1.5.0

- old
+ new

@@ -28,11 +28,11 @@ # Initialize the instance variables on the remountable class, and the base_instance # an instance that will be used to create the set up but will not be mounted def initial_setup(base_instance_parent) @instances = [] - @setup = [] + @setup = Set.new @base_parent = base_instance_parent @base_instance = mount_instance end # Redefines all methods so that are forwarded to add_setup and be recorded @@ -88,10 +88,10 @@ # The remountable class can have a configuration hash to provide some dynamic class-level variables. # For instance, a descripcion could be done using: `desc configuration[:description]` if it may vary # depending on where the endpoint is mounted. Use with care, if you find yourself using configuration # too much, you may actually want to provide a new API rather than remount it. - def mount_instance(opts = {}) + def mount_instance(**opts) instance = Class.new(@base_parent) instance.configuration = Grape::Util::EndpointConfiguration.new(opts[:configuration] || {}) instance.base = self replay_setup_on(instance) instance