lib/dry/schema/processor.rb in dry-schema-0.2.0 vs lib/dry/schema/processor.rb in dry-schema-0.3.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require 'dry/configurable' require 'dry/initializer' require 'dry/schema/type_registry' require 'dry/schema/rule_applier' @@ -109,9 +111,18 @@ # @return [Dry::Types::Safe] # # @api private def type_schema @__type_schema__ ||= steps.detect { |s| s.is_a?(ValueCoercer) }.type_schema + end + + # Return the rules config + # + # @return [Dry::Types::Config] + # + # @api private + def config + @__config__ ||= steps.detect { |s| s.is_a?(RuleApplier) }.config end # Return AST representation of the rules # # @api private