Method: Conditions::InCondition#apply

Defined in:
lib/conditions.rb

#apply(value) ⇒ true, false

Parameters:

  • value (Any, Array)

    A value to be checked against the predicate

Returns:

  • (true)

    if value and predicate have overlapping values

  • (false)

    if value and predicate have no overlapping values



36
37
38
39
# File 'lib/conditions.rb', line 36

def apply(value)
  value = [value] unless value.is_a? Array
  (value & @predicate).any?
end