Class: Collins::None
Overview
Represents a missing value
Instance Method Summary collapse
-
#empty? ⇒ Boolean
Always true for ‘None`.
- #eql?(other) ⇒ Boolean (also: #==)
-
#get ⇒ Object
Always raises a NameError.
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`
177 178 179 |
# File 'lib/collins/option.rb', line 177 def empty? true end |
#eql?(other) ⇒ Boolean Also known as: ==
185 186 187 |
# File 'lib/collins/option.rb', line 185 def eql? other self.class.equal?(other.class) end |
#get ⇒ Object
Always raises a NameError
182 183 184 |
# File 'lib/collins/option.rb', line 182 def get raise NameError.new("None.get") end |