Method: Monadic::Monad#join

Defined in:
lib/monadic/monad.rb

#join(value) ⇒ Object

If the passed value is monad already, get the value to avoid nesting M[M] is equivalent to M



14
15
16
17
# File 'lib/monadic/monad.rb', line 14

def join(value)
  if value.is_a? self.class then value.fetch
  else value end
end