class Conditions::AnyCondition

Checks if any values in the array are true

Public Instance Methods

apply(value) click to toggle source

@param [Any, Array] value @return [true] if value is truthy (or has at least one truthy value) @return [false] if the value is not truthy (or has no truthy values)

# File lib/conditions.rb, line 70
def apply(value)
  value = [value] unless value.is_a? Array
  value.any?
end