support/ruby/collins-client/lib/collins/option.rb
def filter &predicate
      if empty? || predicate.call(get) then
        self
      else
        None.new
      end
    end
# Convert to `None` if predicate fails
#
# Returns this option if it is non-empty *and* applying the predicate to this options returns
# true. Otherwise return `None`.
#
# @yieldparam [Object] predicate The current value
# @yieldreturn [Boolean] result of testing value
# @return [Option<Object>] `None` if predicate fails, or already `None`
Convert to `None` if predicate fails
Returns this option if it is non-empty *and* applying the predicate to this options returns
true. Otherwise return `None`.
Convert to ` None ` if predicate fails Returns this option if it is non - empty * and * applying the predicate to this options returns true . Otherwise return ` None ` .
def filter &predicate
      if empty? || predicate.call(get) then
        self
      else
        None.new
      end
    end
def filter & predicate if empty? || predicate . call ( get ) then self else None . new end end
Convert to `None` if predicate fails
Returns this option if it is non-empty *and* applying the predicate to this options returns
true.
Convert to ` None ` if predicate fails Returns this option if it is non - empty * and * applying the predicate to this options returns true .
result of testing value
result of testing value
Boolean
`None` if predicate fails, or already `None`
` None ` if predicate fails or already ` None `
Option<Object>
predicate
predicate The current value
predicate The current value