class Fear::NoneClass

@api private

Constants

EXTRACTOR

Public Class Methods

inherited(*) click to toggle source
# File lib/fear/none.rb, line 92
def inherited(*)
  raise "you are not allowed to inherit from NoneClass, use Fear::None instead"
end
new() click to toggle source
# File lib/fear/none.rb, line 88
def new
  None
end

Public Instance Methods

==(other) click to toggle source

@param other [Any] @return [Boolean]

# File lib/fear/none.rb, line 54
def ==(other)
  other.is_a?(NoneClass)
end
===(other) click to toggle source

@param other @return [Boolean]

# File lib/fear/none.rb, line 60
def ===(other)
  self == other
end
empty?() click to toggle source

@return [true]

# File lib/fear/none.rb, line 30
def empty?
  true
end
filter_map() click to toggle source

@return [RightBiased::Left]

# File lib/fear/none.rb, line 75
def filter_map
  self
end
get() click to toggle source

@raise [NoSuchElementError]

# File lib/fear/none.rb, line 20
def get
  raise NoSuchElementError
end
inspect() click to toggle source

@return [String]

# File lib/fear/none.rb, line 45
def inspect
  "#<Fear::NoneClass>"
end
Also aliased as: to_s
or_nil() click to toggle source

@return [nil]

# File lib/fear/none.rb, line 25
def or_nil
  nil
end
reject(*) click to toggle source

@return [None]

# File lib/fear/none.rb, line 40
def reject(*)
  self
end
select(*) click to toggle source

@return [None]

# File lib/fear/none.rb, line 35
def select(*)
  self
end
to_s()

@return [String]

Alias for: inspect
zip(other) click to toggle source

@param other [Fear::Option] @return [Fear::Option]

# File lib/fear/none.rb, line 66
def zip(other)
  if other.is_a?(Option)
    Fear.none
  else
    raise TypeError, "can't zip with #{other.class}"
  end
end