lib/validators/tld.rb in validators-3.0.0 vs lib/validators/tld.rb in validators-3.0.1

- old
+ new

@@ -7,12 +7,12 @@ def self.all @all ||= JSON.parse(File.read(FILE_PATH)) end def self.host_with_valid_tld?(host) - return false if host.split(".").size == 1 + return false if host.to_s.split(".").size == 1 - valid? host[/\.([^.]+)$/, 1].to_s.downcase + valid?(host[/\.([^.]+)$/, 1].to_s.downcase) end def self.valid?(tld) all.include?(tld) end