class StringSatisfy::OrRule
Boolean test for 'or' rule, like A | B
Public Instance Methods
satisfied_with?(*objects)
click to toggle source
# File lib/string_satisfy/rule.rb, line 29 def satisfied_with?(*objects) objects = objects.map {|object| object.gsub(/\s+/, '') }.uniq return true if normal_objects.any? {|normal_object| objects.include? normal_object } return true if rule_objects.any? {|rule_object| rule_object.satisfied_with? *objects } false end