Sha256: e2cd617a7b2aebefcd7b986f7ca2aaf2fc459e42676913068bbef7d81bc113ab

Contents?: true

Size: 277 Bytes

Versions: 1

Compression:

Stored size: 277 Bytes

Contents

module ValidatesHost
  class DomainName
    def initialize(domain_name)
      @domain_name = domain_name
    end

    def valid?
      return true if @domain_name.blank?
      @domain_name =~ /^[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validates_host-1.1.0 lib/validates_host/domain_name.rb