Class: Kleisli::Validation::Failure
- Inherits:
-
Either::Left
- Object
- Either::Left
- Kleisli::Validation::Failure
- Defined in:
- lib/kleisli/validation.rb
Instance Method Summary collapse
- #*(other) ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Instance Method Details
#*(other) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/kleisli/validation.rb', line 27 def *(other) if other.class == Failure unless self.left.class == other.left.class && self.left.respond_to?(:sappend) raise ArgumentError, "Failures must contain members of a common Semigroup" end Failure(self.left.sappend(other.left)) else self end end |
#to_s ⇒ Object Also known as: inspect
40 41 42 |
# File 'lib/kleisli/validation.rb', line 40 def to_s "Failure(#{@left.inspect})" end |