Class: Parxer::Validator::Url

Inherits:
Base
  • Object
show all
Defined in:
lib/parxer/validators/url_validator.rb

Instance Attribute Summary

Attributes inherited from Base

#config

Instance Method Summary collapse

Methods inherited from Base

#id, #initialize

Constructor Details

This class inherits a constructor from Parxer::Validator::Base

Instance Method Details

#validateObject



4
5
6
7
8
# File 'lib/parxer/validators/url_validator.rb', line 4

def validate
  v = context.value.to_s
  return true if v.blank?
  !!(v =~ URI.regexp)
end