Ruby 3.2.0 リファレンスマニュアル > ライブラリ一覧 > uriライブラリ > URI::Genericクラス > user

instance method URI::Generic#user

user -> String | nil[permalink][rdoc]

自身の userinfo を文字列で返します。

userinfo が「username:password」の形式である場合は、username 部を返します。設定されていない場合は nil を返します。