Sha256: fb25b7a6128c06808a031bcb110ff0e32902d88db2f8f8fda4585a6cb5f127ff

Contents?: true

Size: 939 Bytes

Versions: 13

Compression:

Stored size: 939 Bytes

Contents

module Grape
  module Extensions
    module ActiveSupport
      module HashWithIndifferentAccess
        module ParamBuilder
          extend ::ActiveSupport::Concern

          included do
            namespace_inheritable(:build_params_with, Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder)
          end

          def params_builder
            Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder
          end

          def build_params
            params = ::ActiveSupport::HashWithIndifferentAccess[rack_params]
            params.deep_merge!(grape_routing_args) if env[Grape::Env::GRAPE_ROUTING_ARGS]
            # TODO: remove, in Rails 4 or later ::ActiveSupport::HashWithIndifferentAccess converts nested Hashes into indifferent access ones
            DeepHashWithIndifferentAccess.deep_hash_with_indifferent_access(params)
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.5 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.4 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.3 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.2 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.1 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.2.0 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.1.0 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.0.3 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.0.2 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.0.1 lib/grape/extensions/active_support/hash_with_indifferent_access.rb
grape-1.0.0 lib/grape/extensions/active_support/hash_with_indifferent_access.rb