mirror of
https://github.com/Evolix/chexpire.git
synced 2024-07-01 05:22:53 +02:00
13 lines
216 B
Ruby
13 lines
216 B
Ruby
module DomainHelper
|
|
def normalize_domain(str)
|
|
str.strip.downcase
|
|
end
|
|
|
|
def tld(str)
|
|
parts = normalize_domain(str).split(".")
|
|
fail ArgumentError unless parts.size >= 2
|
|
|
|
".#{parts.last}"
|
|
end
|
|
end
|