Class: Dry::Schema::TypesMerger::ValueMerger Private
- Inherits:
-
Object
- Object
- Dry::Schema::TypesMerger::ValueMerger
- Defined in:
- lib/dry/schema/types_merger.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #new ⇒ Object readonly private
- #old ⇒ Object readonly private
- #op_class ⇒ Object readonly private
- #types_merger ⇒ Object readonly private
Instance Method Summary collapse
- #call ⇒ Object private
-
#initialize(types_merger, op_class, old, new) ⇒ ValueMerger
constructor
private
A new instance of ValueMerger.
Constructor Details
#initialize(types_merger, op_class, old, new) ⇒ ValueMerger
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 ValueMerger.
21 22 23 24 25 26 |
# File 'lib/dry/schema/types_merger.rb', line 21 def initialize(types_merger, op_class, old, new) @types_merger = types_merger @op_class = op_class @old = old @new = new end |
Instance Attribute Details
#new ⇒ 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.
18 19 20 |
# File 'lib/dry/schema/types_merger.rb', line 18 def new @new end |
#old ⇒ 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/types_merger.rb', line 17 def old @old end |
#op_class ⇒ 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.
16 17 18 |
# File 'lib/dry/schema/types_merger.rb', line 16 def op_class @op_class end |
#types_merger ⇒ 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.
15 16 17 |
# File 'lib/dry/schema/types_merger.rb', line 15 def types_merger @types_merger end |
Instance Method Details
#call ⇒ 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.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/dry/schema/types_merger.rb', line 29 def call if op_class <= Dry::Logic::Operations::Or merge_or elsif op_class <= Dry::Logic::Operations::And merge_and elsif op_class <= Dry::Logic::Operations::Implication merge_implication else raise ArgumentError, <<~MESSAGE Can't merge operations, op_class=#{op_class} MESSAGE end end |