Sha256: efcbced08f714375dac1b93896f488a72eaedaa149744d31f6697bf8a0510de7

Contents?: true

Size: 315 Bytes

Versions: 2

Compression:

Stored size: 315 Bytes

Contents

# frozen_string_literal: true

require "dry/schema/path"

module Dry
  module Schema
    class Path
      # @api private
      def multi_value?
        last.is_a?(::Array)
      end

      # @api private
      def expand
        to_a[0..-2].product(last).map { |spec| self.class[spec] }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dry-validation-1.11.1 lib/dry/validation/schema_ext.rb
dry-validation-1.11.0 lib/dry/validation/schema_ext.rb