Sha256: 90ee0551aa3926ab8caf91449a471c150c7de1b3280eeca21310ed229b781224

Contents?: true

Size: 669 Bytes

Versions: 10

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

module Doorkeeper
  class Config
    # Abstract base class for Doorkeeper and it's extensions configuration
    # builder. Instantiates and validates gem configuration.
    #
    class AbstractBuilder
      attr_reader :config

      # @param [Class] config class
      #
      def initialize(config = Config.new, &block)
        @config = config
        instance_eval(&block) if block_given?
      end

      # Builds and validates configuration.
      #
      # @return [Doorkeeper::Config] config instance
      #
      def build
        @config.validate! if @config.respond_to?(:validate!)
        @config
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
doorkeeper-5.8.0 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.7.1 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.7.0 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.9 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.8 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.7 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.6 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.5 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.4 lib/doorkeeper/config/abstract_builder.rb
doorkeeper-5.6.3 lib/doorkeeper/config/abstract_builder.rb