Method: Collins::Option#filter_not

Defined in:
lib/collins/option.rb

#filter_not(&predicate) ⇒ Option<Object>

Inverse of ‘filter` operation.

Returns this option if it is non-empty and applying the predicate to this option returns false. Otherwise return ‘None`.

Returns:

See Also:



164
165
166
167
168
169
170
# File 'lib/collins/option.rb', line 164

def filter_not &predicate
  if empty? || !predicate.call(get) then
    self
  else
    None.new
  end
end