Sha256: 44ec2a059b2ffafa8a51b5b448146600e42c354d298a20642448b02c8a95adc0

Contents?: true

Size: 600 Bytes

Versions: 5

Compression:

Stored size: 600 Bytes

Contents

# frozen_string_literal: true

module Dry
  module Configurable
    # Common API for both classes and instances
    #
    # @api public
    module Methods
      # @api public
      def configure(&block)
        raise FrozenConfigError, "Cannot modify frozen config" if config.frozen?

        yield(config) if block
        self
      end

      # Finalize and freeze configuration
      #
      # @return [Dry::Configurable::Config]
      #
      # @api public
      def finalize!(freeze_values: false)
        config.finalize!(freeze_values: freeze_values)
        self
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dry-configurable-1.3.0 lib/dry/configurable/methods.rb
dry-configurable-1.2.0 lib/dry/configurable/methods.rb
dry-configurable-1.1.0 lib/dry/configurable/methods.rb
dry-configurable-1.0.1 lib/dry/configurable/methods.rb
dry-configurable-1.0.0 lib/dry/configurable/methods.rb