Module: TLDv

Defined in:
lib/tldv.rb,
lib/tldv/version.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.valid?(tld) ⇒ bool

checks if a TLD is valid

Parameters:

  • tld (String)

    the TLD to check, e.g. ‘example`

Returns:

  • (bool)

    ‘true` if the TLD is valid, `false` otherwise



14
15
16
# File 'lib/tldv.rb', line 14

def valid?(tld)
  Data::TLDS.include?(tld.downcase)
end