class Rumonade::Left

The left side of the disjoint union, as opposed to the Right side.

Attributes

left_value[R]

@return Returns the left value

Public Class Methods

new(left_value) click to toggle source

@param left_value the value to store in a Left, usually representing a failure result

# File lib/rumonade/either.rb, line 98
def initialize(left_value)
  @left_value = left_value
end

Public Instance Methods

==(other) click to toggle source

@return [Boolean] Returns true if other is a Left with an equal left value

# File lib/rumonade/either.rb, line 106
def ==(other)
  other.is_a?(Left) && other.left_value == self.left_value
end
inspect() click to toggle source

@return [String] Returns a String containing a human-readable representation of this object.

# File lib/rumonade/either.rb, line 116
def inspect
  "Left(#{left_value.inspect})"
end
to_s() click to toggle source

@return [String] Returns a String representation of this object.

# File lib/rumonade/either.rb, line 111
def to_s
  "Left(#{left_value})"
end