Sha256: 34eaff8d9f167c5f4244fc6c9c5e224ab593d6b1de4f4141e53943a139f81f23

Contents?: true

Size: 492 Bytes

Versions: 1

Compression:

Stored size: 492 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'aequitas/rule/format'

module Aequitas
  class Rule
    class Format
      class Proc < Format

        def valid?(resource)
          value = attribute_value(resource)

          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 # class Format
  end # class Rule
end # module Aequitas

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aequitas-0.0.2 lib/aequitas/rule/format/proc.rb