Sha256: 35894d09cb74903c1a75bc18877d9d765a991872a12f33d02ae720236e0da0f0

Contents?: true

Size: 1.19 KB

Versions: 4

Compression:

Stored size: 1.19 KB

Contents

#--
# Public Suffix Service
#
# Domain Name parser based on the Public Suffix List.
#
# Copyright (c) 2009-2011 Simone Carletti <weppos@weppos.net>
#++


module PublicSuffixService

  class Error < StandardError
  end

  # Raised when trying to parse an invalid domain.
  # A domain is considered invalid when no rule is found
  # in the definition list.
  #
  # @example
  #
  #   PublicSuffixService.parse("nic.test")
  #   # => PublicSuffixService::DomainInvalid
  #
  #   PublicSuffixService.parse("http://www.nic.it")
  #   # => PublicSuffixService::DomainInvalid
  #
  # @since 0.6.0
  #
  class DomainInvalid < Error
  end

  # Raised when trying to parse a domain
  # which is formally defined by a rule,
  # but the rules set a requirement which is not satisfied
  # by the input you are trying to parse.
  #
  # @example
  #
  #   PublicSuffixService.parse("nic.do")
  #   # => PublicSuffixService::DomainNotAllowed
  #
  #   PublicSuffixService.parse("www.nic.do")
  #   # => PublicSuffixService::Domain
  #
  # @since 0.6.0
  #
  class DomainNotAllowed < DomainInvalid
  end


  # Backward Compatibility
  #
  # @deprecated Use {PublicSuffixService::DomainInvalid}.
  #
  InvalidDomain = DomainInvalid

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
public_suffix_service-0.9.0 lib/public_suffix_service/errors.rb
public_suffix_service-0.8.4 lib/public_suffix_service/errors.rb
public_suffix_service-0.8.3 lib/public_suffix_service/errors.rb
public_suffix_service-0.8.2 lib/public_suffix_service/errors.rb