class LIVR::Rules::Special::Url

Constants

MAX_URL_LENGTH
URL_RE
URL_RE_STR

Public Instance Methods

call(value, user_data, field_results) click to toggle source
# File lib/livr/rules/special.rb, line 37
def call(value, user_data, field_results)
  return if is_no_value(value)
  return 'FORMAT_ERROR' if !is_primitive(value)

  if value.length < MAX_URL_LENGTH && URL_RE.match(value)
    return
  else
    'WRONG_URL'
  end
end