class SuframaValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/br_documents/suframa_validator.rb, line 2
def validate_each(record, attribute, value)
  return if value.blank?

  suframa = BrDocuments::Suframa.new(value)
  record.errors.add(attribute, :invalid) unless suframa.valid?
end