Sha256: 001ccb1ebba2004ea67a0f4e7af58e27204504870232396c4f580649bdd7bb75

Contents?: true

Size: 599 Bytes

Versions: 5

Compression:

Stored size: 599 Bytes

Contents

module Grape
  module Config
    class Configuration
      ATTRIBUTES = %i[
        param_builder
      ].freeze

      attr_accessor(*ATTRIBUTES)

      def initialize
        reset
      end

      def reset
        self.param_builder = Grape::Extensions::ActiveSupport::HashWithIndifferentAccess::ParamBuilder
      end
    end

    def self.extended(base)
      def base.configure
        block_given? ? yield(config) : config
      end

      def base.config
        @configuration ||= Grape::Config::Configuration.new
      end
    end
  end
end

Grape.extend Grape::Config
Grape.config.reset

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/config.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/config.rb
grape-1.2.5 lib/grape/config.rb
grape-1.2.4 lib/grape/config.rb
grape-1.2.3 lib/grape/config.rb