class Rumonade::Right

The right side of the disjoint union, as opposed to the Left side.

Attributes

right_value[R]

@return Returns the right value

Public Class Methods

new(right_value) click to toggle source

@param right_value the value to store in a Right, usually representing a success result

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

Public Instance Methods

==(other) click to toggle source

@return [Boolean] Returns true if other is a Right with an equal right value

# File lib/rumonade/either.rb, line 132
def ==(other)
  other.is_a?(Right) && other.right_value == self.right_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 142
def inspect
  "Right(#{right_value.inspect})"
end
to_s() click to toggle source

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

# File lib/rumonade/either.rb, line 137
def to_s
  "Right(#{right_value})"
end