class Dry::Schema::Message::Or::MultiPath

A message type used by OR operations with different paths

@api public

Attributes

root[R]

@api private

Public Class Methods

new(*args) click to toggle source

@api private

Calls superclass method Dry::Schema::Message::Or::Abstract::new
# File lib/dry/schema/message/or/multi_path.rb, line 20
def initialize(*args)
  super
  @root = [left, right].flatten.map(&:_path).reduce(:&)
  @left = left.map { |msg| msg.to_or(root) }
  @right = right.map { |msg| msg.to_or(root) }
end

Public Instance Methods

hint?() click to toggle source

@api private

# File lib/dry/schema/extensions/hints.rb, line 34
def hint?
  false
end
to_h() click to toggle source

@api public

# File lib/dry/schema/message/or/multi_path.rb, line 28
def to_h
  @to_h ||= Path[[*root, :or]].to_h(
    [left.map(&:to_h).reduce(:merge), right.map(&:to_h).reduce(:merge)]
  )
end