Method: Addressable::URI#tld=
- Defined in:
- lib/addressable/uri.rb
#tld=(new_tld) ⇒ Object
Sets the top-level domain for this URI.
1215 1216 1217 1218 |
# File 'lib/addressable/uri.rb', line 1215 def tld=(new_tld) replaced_tld = host.sub(/#{tld}\z/, new_tld) self.host = PublicSuffix::Domain.new(replaced_tld).to_s end |