class Addressable::URI

def dup

Returns:
  • (Addressable::URI) - The cloned URI.
def dup
  duplicated_uri = self.class.new(
    :scheme => self.scheme ? self.scheme.dup : nil,
    :user => self.user ? self.user.dup : nil,
    :password => self.password ? self.password.dup : nil,
    :host => self.host ? self.host.dup : nil,
    :port => self.port,
    :path => self.path ? self.path.dup : nil,
    :query => self.query ? self.query.dup : nil,
    :fragment => self.fragment ? self.fragment.dup : nil
  )
  return duplicated_uri
end