Module: Shared

Included in:
Either::Left, Either::Right, Maybe::Just, Maybe::Nothing
Defined in:
lib/shared.rb

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Object



2
3
4
5
# File 'lib/shared.rb', line 2

def ==(other)
  self.class == other.class &&
    other.val_eq?(val)
end

#val_eq?(other_val) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/shared.rb', line 7

def val_eq?(other_val)
  other_val == val
end