Top Level Namespace

Defined Under Namespace

Modules: JustMaybe Classes: Just, Nothing

Instance Method Summary collapse

Instance Method Details

#Just(object) ⇒ Object



23
24
25
# File 'lib/just_maybe/just.rb', line 23

def Just(object)
  Just.new(object)
end

#Maybe(object) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/just_maybe.rb', line 5

def Maybe(object)
  if object.nil?
    Nothing.instance
  else
    Just(object)
  end
end