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