Module: UrlFormat
- Defined in:
- lib/url_format.rb,
lib/url_format/version.rb
Constant Summary collapse
- VERSION =
"0.0.8"
Class Method Summary collapse
Class Method Details
.get_domain(url) ⇒ Object
7 8 9 10 11 |
# File 'lib/url_format.rb', line 7 def self.get_domain(url) host = URI.parse(url).host.downcase host.start_with?('www.') ? host[4..-1] : host rescue URI::InvalidURIError end |