Class: Dry::Schema::Message::Or::MultiPath
- Defined in:
- lib/dry/schema/message/or/multi_path.rb,
lib/dry/schema/extensions/hints.rb
Overview
A message type used by OR operations with different paths
Instance Attribute Summary collapse
- #root ⇒ Object readonly private
Attributes inherited from Abstract
Instance Method Summary collapse
- #hint? ⇒ Boolean private
-
#initialize(*args) ⇒ MultiPath
constructor
private
A new instance of MultiPath.
- #to_h ⇒ Object
Constructor Details
#initialize(*args) ⇒ MultiPath
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MultiPath.
20 21 22 23 24 25 |
# 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 |
Instance Attribute Details
#root ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
17 18 19 |
# File 'lib/dry/schema/message/or/multi_path.rb', line 17 def root @root end |
Instance Method Details
#hint? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
34 35 36 |
# File 'lib/dry/schema/extensions/hints.rb', line 34 def hint? false end |