Sha256: a2311dc00b4c4dcab303379e6b10cf0bd28af27679823c50f43c4edeca847bf4
Contents?: true
Size: 747 Bytes
Versions: 16
Compression:
Stored size: 747 Bytes
Contents
# frozen_string_literal: true require "dry/schema/message/or/single_path" require "dry/schema/message/or/multi_path" module Dry module Schema # Message objects used by message sets # # @api public class Message module Or # @api private def self.[](left, right, messages) msgs = [left, right].flatten paths = msgs.map(&:path) if paths.uniq.size == 1 SinglePath.new(left, right, messages) elsif right.is_a?(Array) if left.is_a?(Array) && paths.uniq.size > 1 MultiPath.new(left, right) else right end else msgs.max end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems