Top Level Namespace

Defined Under Namespace

Modules: Switchyard Classes: Null, Object

Instance Method Summary collapse

Instance Method Details

#Maybe(obj) ⇒ Object

rubocop:disable Naming/MethodName



14
15
16
17
18
19
20
# File 'lib/switchyard/functional/maybe.rb', line 14

def Maybe(obj)
  Switchyard::Deprecations.warn(
    "Maybe()/Null are deprecated and will be removed in a future release; " \
    "use Switchyard::Option (Some/None) instead"
  )
  obj.nil? ? Null.instance : obj
end