Module: RFunc::Option

Defined in:
lib/rfunc/option.rb

Class Method Summary collapse

Class Method Details

.new(something_or_nothing) ⇒ Object



325
326
327
328
329
330
331
332
# File 'lib/rfunc/option.rb', line 325

def self.new(something_or_nothing)
  case something_or_nothing.nil?
    when false
      Some.new(something_or_nothing)
    else
      None.new
  end
end