Class: Monads::Just

Inherits:
Maybe
  • Object
show all
Defined in:
lib/ruby-monads/maybe.rb

Class Method Summary collapse

Methods inherited from Maybe

#bind, unit, #unwrap

Methods included from Monad

#fmap, included, #initialize, #join, #method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Monads::Monad

Class Method Details

.new(value) ⇒ Object

Raises:

  • (TypeError)


30
31
32
33
# File 'lib/ruby-monads/maybe.rb', line 30

def self.new(value)
  raise TypeError, "value should not be of #{value.class}" if value.nil?
  super
end