Class: Collins::None

Inherits:
Option show all
Defined in:
lib/collins/option.rb

Overview

Represents a missing value

Instance Method Summary collapse

Methods inherited from Option

#defined?, #exists?, #filter, #filter_not, #flat_map, #foreach, #get_or_else, #map, #or_else

Instance Method Details

#empty?Boolean

Always true for ‘None`

Returns:

  • (Boolean)

See Also:



177
178
179
# File 'lib/collins/option.rb', line 177

def empty?
  true
end

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


185
186
187
# File 'lib/collins/option.rb', line 185

def eql? other
  self.class.equal?(other.class)
end

#getObject

Always raises a NameError

Raises:

  • (NameError)


182
183
184
# File 'lib/collins/option.rb', line 182

def get
  raise NameError.new("None.get")
end