lib/grape/api.rb in grape-1.3.0 vs lib/grape/api.rb in grape-1.3.1
- old
+ new
@@ -6,11 +6,11 @@
module Grape
# The API class is the primary entry point for creating Grape APIs. Users
# should subclass this class in order to build an API.
class API
# Class methods that we want to call on the API rather than on the API object
- NON_OVERRIDABLE = (Class.new.methods + %i[call call! configuration compile!]).freeze
+ NON_OVERRIDABLE = (Class.new.methods + %i[call call! configuration compile! inherited]).freeze
class << self
attr_accessor :base_instance, :instances
# Rather than initializing an object of type Grape::API, create an object of type Instance
@@ -173,10 +173,10 @@
def evaluate_arguments(configuration, *args)
args.map do |argument|
if argument.respond_to?(:lazy?) && argument.lazy?
argument.evaluate_from(configuration)
elsif argument.is_a?(Hash)
- argument.map { |key, value| [key, evaluate_arguments(configuration, value).first] }.to_h
+ argument.transform_values { |value| evaluate_arguments(configuration, value).first }
elsif argument.is_a?(Array)
evaluate_arguments(configuration, *argument)
else
argument
end