lib/aequitas/rule/format/proc.rb in aequitas-0.0.1 vs lib/aequitas/rule/format/proc.rb in aequitas-0.0.2

- old
+ new

@@ -2,27 +2,21 @@ require 'aequitas/rule/format' module Aequitas class Rule - module Format - class Proc < Rule + class Format + class Proc < Format - include Format - - equalize_on *(superclass.equalizer.keys + [:format]) - - def valid?(resource) value = attribute_value(resource) - return true if skip?(value) - self.format.call(value) + skip?(value) || format.call(value) # rescue ::Encoding::CompatibilityError # # This is to work around a bug in jruby - see formats/email.rb # false end end # class Proc - end # module Format + end # class Format end # class Rule end # module Aequitas