種類
- インスタンスメソッド (23)
- 特異メソッド (4)
- 定数 (2)
ライブラリ
- uri (29)
キーワード
- COMPONENT (1)
-
DEFAULT
_ PORT (1) - absolute (1)
- absolute? (1)
- coerce (1)
- component (2)
-
default
_ port (2) - fragment (1)
- host (1)
- hostname (1)
- new (1)
- normalize! (1)
- opaque (1)
- password (1)
- path (1)
- port (1)
- query (1)
- registry (1)
- relative? (1)
-
route
_ from (1) -
route
_ to (1) - scheme (1)
- select (1)
-
to
_ s (1) -
use
_ registry (1) - user (1)
- userinfo (1)
検索結果
先頭5件
-
URI
:: Generic # registry -> String | nil (18904.0) -
自身の registry を文字列で返します。設定されていない場合は nil を返します。
自身の registry を文字列で返します。設定されていない場合は nil を返します。 -
URI
:: Generic # route _ to(dst) -> URI :: Generic (18622.0) -
自身から dst への相対パスを返します。
...自身から dst への相対パスを返します。
@param dst URI を文字列かURIオブジェクトで与えます。
例:
require 'uri'
p URI.parse('http://example.com/').route_to('http://example.com/foo/bar.html')
#=> #<URI::Generic:0x20100198 URL:foo/bar.html>... -
URI
:: Generic # absolute -> bool (18604.0) -
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
例:
require 'uri'
p URI.parse('http://example.com/').absolute? #=> true
p URI.parse('./').absolute? #=> false -
URI
:: Generic # absolute? -> bool (18604.0) -
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。
例:
require 'uri'
p URI.parse('http://example.com/').absolute? #=> true
p URI.parse('./').absolute? #=> false -
URI
:: Generic # component -> [Symbol] (18604.0) -
self.class.component を返します。
...self.class.component を返します。
@see URI::Generic.component... -
URI
:: Generic # default _ port -> Integer | nil (18604.0) -
self.class.default_port を返します。
...self.class.default_port を返します。
@see URI::Generic.default_port... -
URI
:: Generic # fragment -> String | nil (18604.0) -
自身の fragment を文字列で返します。設定されていない場合は nil を返します。
自身の fragment を文字列で返します。設定されていない場合は nil を返します。
例:
require 'uri'
u = URI.parse('http://example.com/#frgmt')
p u.fragment #=> "frgmt" -
URI
:: Generic # host -> String | nil (18604.0) -
自身の host を文字列で返します。設定されていない場合は nil を返します。
...自身の host を文字列で返します。設定されていない場合は nil を返します。
@see URI::Generic#hostname... -
URI
:: Generic # hostname -> String | nil (18604.0) -
自身の hostname を文字列で返します。また、URI::Generic#host が設 定されていない場合は nil を返します。
...自身の hostname を文字列で返します。また、URI::Generic#host が設
定されていない場合は nil を返します。
このメソッドは URI::Generic#host に IPv6 アドレスが設定されていた
場合はブラケットを削除した文字列を返しますがそれ以... -
URI
:: Generic # path -> String | nil (18604.0) -
自身の path を文字列で返します。設定されていない場合は nil を返します。
自身の path を文字列で返します。設定されていない場合は nil を返します。
require 'uri'
p URI.parse('http://example.com/hoge').path #=> "/hoge"
p URI.parse('http://example.com').path #=> ""
p URI.parse('mailto:nospam@localhost').path #=> nil
p URI('ftp://example.com/foo').path #=> 'foo'
p UR... -
URI
:: Generic # port -> String | nil (18604.0) -
自身の port を文字列で返します。設定されていない場合は nil を返します。
自身の port を文字列で返します。設定されていない場合は nil を返します。 -
URI
:: Generic # relative? -> bool (18604.0) -
自身に scheme が設定されていないなら true を返します。そうでない場合は false を返します。
自身に scheme が設定されていないなら true を返します。そうでない場合は false を返します。
例:
require 'uri'
p URI.parse('http://example.com/').relative? #=> false
p URI.parse('./').relative? #=> true -
URI
:: Generic # select(*components) -> [String] (18604.0) -
指定された components に対応する構成要素を文字列の配列として返します。
指定された components に対応する構成要素を文字列の配列として返します。
@param components 構成要素名をシンボルで指定します。
例:
require 'uri'
uri = URI.parse('http://myuser:mypass@my.example.com/test.rbx')
p uri.select(:userinfo, :host, :path)
# => ["myuser:mypass", "my.example.com", "/test.rbx"] -
URI
:: Generic # to _ s -> String (18604.0) -
自身が表す URI を文字列として返します。
自身が表す URI を文字列として返します。
例:
require 'uri'
p URI.parse('http://example.com/').to_s #=> "http://example.com/" -
URI
:: Generic . component -> [Symbol] (18604.0) -
URI の構成要素を表すシンボルの配列を返します。
...URI の構成要素を表すシンボルの配列を返します。
require 'uri'
p URI::Generic.component
p URI::MailTo.component
# => [:scheme, :userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment]
# => [:scheme, :to, :headers]... -
URI
:: Generic . default _ port -> Integer | nil (18604.0) -
スキームに対応するデフォルトのポート番号を整数で返します。
...スキームに対応するデフォルトのポート番号を整数で返します。
require 'uri'
URI::Generic.default_port # => nil
URI::FTP.default_port # => 21
URI::HTTP.default_port # => 80
URI::HTTPS.default_port # => 443
URI::LDAP.default_port... -
URI
:: Generic . use _ registry -> bool (18604.0) -
構成要素 registry を受け付けるなら true を返します。 URI::Generic クラスでは false です。
...構成要素 registry を受け付けるなら true を返します。
URI::Generic クラスでは false です。... -
URI
:: Generic :: COMPONENT -> [Symbol] (18604.0) -
URI::Generic で利用可能なコンポーネントの一覧です。
...
URI::Generic で利用可能なコンポーネントの一覧です。... -
URI
:: Generic :: DEFAULT _ PORT -> nil (18604.0) -
URI::Generic のデフォルトポート(nil)です。
...
URI::Generic のデフォルトポート(nil)です。... -
URI
:: Generic # route _ from(src) -> URI :: Generic (9622.0) -
与えられた URI を表す src からの相対パスを返します。
...rc からの相対パスを返します。
@param src 自身の相対パスを算出するための、ルートとなる Absolute URI を与えます。
例:
require 'uri'
p URI.parse('http://example.com/foo/bar.html') - 'http://example.com/'
#=> #<URI::Generic:0x20100256 URL:foo/bar.html>... -
URI
:: Generic . new(scheme , userinfo , host , port , registry , path , opaque , query , fragment , parser = URI :: DEFAULT _ PARSER , arg _ check = false) -> URI :: Generic (1204.0) -
各引数を成分とする URI::Generic オブジェクトを生成して返します。
...各引数を成分とする URI::Generic オブジェクトを生成して返します。
@param scheme 構成要素 scheme を表す文字列を与えます。
@param userinfo 構成要素を表す文字列を与えます。
@param host 構成要素を表す文字列を与えます。
@param p... -
URI
:: Generic # coerce(oth) -> [URI , URI] (604.0) -
引数 oth をパースして [パース後の oth, self] の配列を返します。
引数 oth をパースして [パース後の oth, self] の配列を返します。
@param oth URI オブジェクトか文字列を指定します。
例:
require 'uri'
uri = URI.parse("http://my.example.com")
uri.coerce("http://foo.com")
# => [#<URI::HTTP:0x00000000bcb028 URL:http://foo.com/>, #<URI::HTTP:0x00000000d92178 URL:http://my.example.com>] -
URI
:: Generic # normalize! -> String | nil (604.0) -
URI オブジェクトを正規化して返します。ホスト名を小文字にし、パスと 構成要素がなければ '/' をセットします。
URI オブジェクトを正規化して返します。ホスト名を小文字にし、パスと
構成要素がなければ '/' をセットします。
例:
require 'uri'
u = URI.parse('http://Example.Com')
p u.to_s #=> "http://Example.Com"
p u.normalize.to_s #=> "http://example.com/" -
URI
:: Generic # opaque -> String | nil (604.0) -
自身の opaque を文字列で返します。設定されていない場合は nil を返します。
自身の opaque を文字列で返します。設定されていない場合は nil を返します。
例:
require 'uri'
p URI.parse('http://example.com/').opaque #=> nil
p URI.parse('mailto:nospam@localhost').opaque #=> "nospam@localhost"
p URI.parse('urn:ietf:rfc:1149').opaque #=> "ietf:rfc:1149" -
URI
:: Generic # password -> String | nil (604.0) -
自身の password を文字列で返します。設定されていない場合は nil を返します。
自身の password を文字列で返します。設定されていない場合は nil を返します。 -
URI
:: Generic # query -> String | nil (604.0) -
自身の query を文字列で返します。設定されていない場合は nil を返します。
自身の query を文字列で返します。設定されていない場合は nil を返します。
例:
require 'uri'
p URI.parse('http://example.com/?hoge').query #=> "hoge" -
URI
:: Generic # scheme -> String | nil (604.0) -
自身の scheme を文字列で返します。設定されていない場合は nil を返します。
自身の scheme を文字列で返します。設定されていない場合は nil を返します。 -
URI
:: Generic # user -> String | nil (604.0) -
自身の userinfo を文字列で返します。
自身の userinfo を文字列で返します。
userinfo が「username:password」の形式である場合は、username 部を返します。
設定されていない場合は nil を返します。 -
URI
:: Generic # userinfo -> String | nil (604.0) -
自身の userinfo を "username:password" という形式の文字列で返します。 設定されていない場合は nil を返します。
自身の userinfo を "username:password" という形式の文字列で返します。
設定されていない場合は nil を返します。