class SPS::BICValidator

Constants

REGEX

AnyBICIdentifier (taken from schema)

Public Instance Methods

validate(record) click to toggle source
# File lib/sps_king/validator.rb, line 21
def validate(record)
  field_name = options[:field_name] || :bic
  value = record.send(field_name)

  if value
    unless value.to_s.match(REGEX)
      record.errors.add(field_name, :invalid, message: options[:message])
    end
  end
end