Module: Dry::Monads::Validated::Mixin::Constructors Private
- Included in:
- Dry::Monads, Dry::Monads::Validated::Mixin
- Defined in:
- lib/dry/monads/validated.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Actual constructor methods
Instance Method Summary collapse
-
#Invalid(value = Undefined, &block) ⇒ Object
private
Invalid constructor.
-
#Valid(value = Undefined, &block) ⇒ Object
private
Valid constructor.
Instance Method Details
#Invalid(value) ⇒ Valdated::Invalid #Invalid(&block) ⇒ Valdated::Invalid
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.
Invalid constructor
268 269 270 271 272 273 |
# File 'lib/dry/monads/validated.rb', line 268 def Invalid(value = Undefined, &block) v = Undefined.default(value, block) raise ArgumentError, "No value given" if !value.nil? && v.nil? Invalid.new(v, RightBiased::Left.trace_caller) end |
#Valid(value) ⇒ Valdated::Valid #Valid(&block) ⇒ Valdated::Valid
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.
Valid constructor
251 252 253 254 255 256 |
# File 'lib/dry/monads/validated.rb', line 251 def Valid(value = Undefined, &block) v = Undefined.default(value, block) raise ArgumentError, "No value given" if !value.nil? && v.nil? Valid.new(v) end |