Skip to content
instance method

URI::Generic#fragment=

(::String? v) -> ::String?
fragment=(v)

Checks the fragment v component against the parser Regexp for :FRAGMENT.

Args

v

String

Description

Public setter for the fragment component v (with validation).

Usage

Example
require 'uri'

uri = URI.parse("http://my.example.com/?id=25#time=1305212049")
uri.fragment = "time=1305212086"
uri.to_s  #=> "http://my.example.com/?id=25#time=1305212086"
See also #find_proxy #hash #escape_userpass #hierarchical? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0