Class: Maybe

Inherits:
Object
  • Object
show all
Defined in:
lib/matilda-maybe/maybe.rb

Direct Known Subclasses

Just, Nothing

Class Method Summary collapse

Class Method Details

.from(value) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/matilda-maybe/maybe.rb', line 2

def self.from(value)
  if !value.nil?
    Just.new(value)
  else
    Nothing.new
  end
end