Class: Dry::Schema::Message::Or
- Inherits:
-
Object
- Object
- Dry::Schema::Message::Or
- Includes:
- Enumerable
- Defined in:
- lib/dry/schema/message.rb,
lib/dry/schema/extensions/hints.rb
Overview
Instance Attribute Summary collapse
- #left ⇒ Object readonly private
- #messages ⇒ Object readonly private
- #path ⇒ Object readonly private
- #right ⇒ Object readonly private
Instance Method Summary collapse
- #each(&block) ⇒ Object private
- #hint? ⇒ Boolean private
-
#initialize(left, right, messages) ⇒ Or
constructor
private
A new instance of Or.
- #to_a ⇒ Object private
-
#to_s ⇒ Object
Return a string representation of the message.
Constructor Details
#initialize(left, right, messages) ⇒ Or
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 Or.
35 36 37 38 39 40 |
# File 'lib/dry/schema/message.rb', line 35 def initialize(left, right, ) @left = left @right = right @messages = @path = left.path end |
Instance Attribute Details
#left ⇒ 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.
23 24 25 |
# File 'lib/dry/schema/message.rb', line 23 def left @left end |
#messages ⇒ 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.
32 33 34 |
# File 'lib/dry/schema/message.rb', line 32 def @messages end |
#path ⇒ 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.
29 30 31 |
# File 'lib/dry/schema/message.rb', line 29 def path @path end |
#right ⇒ 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.
26 27 28 |
# File 'lib/dry/schema/message.rb', line 26 def right @right end |
Instance Method Details
#each(&block) ⇒ Object
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.
50 51 52 |
# File 'lib/dry/schema/message.rb', line 50 def each(&block) to_a.each(&block) end |
#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.
23 24 25 |
# File 'lib/dry/schema/extensions/hints.rb', line 23 def hint? false end |
#to_a ⇒ Object
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.
55 56 57 |
# File 'lib/dry/schema/message.rb', line 55 def to_a [left, right] end |
#to_s ⇒ Object
Return a string representation of the message
45 46 47 |
# File 'lib/dry/schema/message.rb', line 45 def to_s uniq.join(" #{[:or]} ") end |