class Validators::TLD
Public Class Methods
all()
click to toggle source
# File lib/validators/tld.rb, line 5 def self.all @all ||= begin Validators.require_dependency! "email_data" EmailData.tlds end end
host_with_valid_tld?(host)
click to toggle source
# File lib/validators/tld.rb, line 13 def self.host_with_valid_tld?(host) host = host.to_s return false if host.split(".").size == 1 include?(host[/\.([^.]+)$/, 1].to_s.downcase) end
include?(tld)
click to toggle source
# File lib/validators/tld.rb, line 21 def self.include?(tld) all.include?(tld) end