Top Level Namespace

Defined Under Namespace

Modules: FunctionalLightService 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/functional-light-service/functional/maybe.rb', line 14

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