Class: Ramda::Internal::Functors::Maybe

Inherits:
Object
  • Object
show all
Defined in:
lib/ramda/internal/functors.rb

Overview

The ‘Maybe` type represents the possibility of some value or nothing.

Defined Under Namespace

Classes: None, Some

Class Method Summary collapse

Class Method Details

.new(x) ⇒ Object



45
46
47
# File 'lib/ramda/internal/functors.rb', line 45

def self.new(x)
  x.nil? ? None.new : Some.new(x)
end

.of(x) ⇒ Object



49
50
51
# File 'lib/ramda/internal/functors.rb', line 49

def self.of(x)
  Some.new(x)
end