Class: Tweed::Monads::Identity

Inherits:
Tweed::Monad show all
Defined in:
lib/tweed/monads/identity.rb

Instance Method Summary collapse

Methods inherited from Tweed::Monad

[], #bind, #lift_m2, return

Instance Method Details

#==(other) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/tweed/monads/identity.rb', line 14

def ==(other)
  if other.is_a? Identity
    @value == other.instance_eval { @value }
  else
    @value == other
  end
end

#inspectObject



10
11
12
# File 'lib/tweed/monads/identity.rb', line 10

def inspect
  "#{self.class.inspect}[#{@value.inspect}]"
end