るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.090秒)
トップページ > バージョン:2.3.0[x] > クエリ:l[x] > クラス:URI::Generic[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l

ライブラリ

キーワード

検索結果

URI::Generic#absolute -> bool (18304.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 (18304.0)

自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。

自身に scheme が設定されているなら true を返します。そうでない場合は false を返します。

例:
require 'uri'
p URI.parse('http://example.com/').absolute? #=> true
p URI.parse('./').absolute? #=> false

URI::Generic#default_port -> Integer | nil (18304.0)

self.class.default_port を返します。

...self.class.default_port を返します。

@see URI::Generic.default_port...

URI::Generic#hierarchical? -> bool (18304.0)

自身に path が設定されているなら true を返します。そうでない場合は false を返します。

自身に path が設定されているなら true を返します。そうでない場合は false を返します。

URI::Generic#normalize -> URI::Generic (18304.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#normalize! -> String | nil (18304.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#relative? -> bool (18304.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] (18304.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.build(ary) -> URI::Generic (18304.0)

引数で与えられた URI 構成要素から URI::Generic オブジェクトを生成します。

...引数で与えられた URI 構成要素から URI::Generic オブジェクトを生成します。

@param ary 構成要素を表す配列を与えます。要素は以下の順です。
//emlist{
[scheme, userinfo, host, port, registry, path, opaque, query, fragment]
//}

@param hash 構...

URI::Generic.build(hash) -> URI::Generic (18304.0)

引数で与えられた URI 構成要素から URI::Generic オブジェクトを生成します。

...引数で与えられた URI 構成要素から URI::Generic オブジェクトを生成します。

@param ary 構成要素を表す配列を与えます。要素は以下の順です。
//emlist{
[scheme, userinfo, host, port, registry, path, opaque, query, fragment]
//}

@param hash 構...

絞り込み条件を変える

URI::Generic.build2(ary) -> URI::Generic (18304.0)

URI::Generic.build と同じですが、例外 URI::InvalidComponentError が発生した場合に、引数の各要素を URI.escape して再度 build を試み ます。

...
URI::Generic
.build と同じですが、例外 URI::InvalidComponentError
が発生した場合に、引数の各要素を URI.escape して再度 build を試み
ます。

@param ary 構成要素を表す文字列の配列を与えます。要素は以下の順です。
//emlist{
[scheme, u...

URI::Generic.build2(hash) -> URI::Generic (18304.0)

URI::Generic.build と同じですが、例外 URI::InvalidComponentError が発生した場合に、引数の各要素を URI.escape して再度 build を試み ます。

...
URI::Generic
.build と同じですが、例外 URI::InvalidComponentError
が発生した場合に、引数の各要素を URI.escape して再度 build を試み
ます。

@param ary 構成要素を表す文字列の配列を与えます。要素は以下の順です。
//emlist{
[scheme, u...

URI::Generic.default_port -> Integer | nil (18304.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::DEFAULT_PORT -> nil (18304.0)

URI::Generic のデフォルトポート(nil)です。

...
URI::Generic
のデフォルトポート(nil)です。...

URI::Generic#+(rel) -> URI::Generic (304.0)

自身と与えられたパス rel を連結した新しい URI オブジェクトを生成して返します。

自身と与えられたパス rel を連結した新しい URI オブジェクトを生成して返します。

3986 の Section 5.2 の仕様に従います。
rel が文字列の場合は URI.parse(rel) によって、URI に変換してから連結します。


@param rel 連結したいパスを文字列か URI オブジェクトで与えます。

例:
require 'uri'
p URI.parse('http://example.com/') + '/foo/bar.html'
#=> #<URI::HTTP:0x201001c0 URL:http://example.com/foo...

絞り込み条件を変える

URI::Generic#==(uri) -> bool (304.0)

引数に指定した URI (文字列またはURIオブジェクト)との一致判定を行い ます。URI は正規化して比較されます。

引数に指定した URI (文字列またはURIオブジェクト)との一致判定を行い
ます。URI は正規化して比較されます。

@param uri 比較したい URI を URI オブジェクトで指定します。

例:
require 'uri'
u1 = URI.parse('http://example.com/?hoge')
u2 = URI.parse('http://Example.Com/?hoge')
p u1 == u2 #=> true

URI::Generic#component -> [Symbol] (304.0)

self.class.component を返します。

...self.class.component を返します。

@see URI::Generic.component...

URI::Generic#find_proxy -> URI | nil (304.0)

プロキシ URI を返します。

プロキシ URI を返します。

プロキシ URI は http_proxy, ftp_proxy, no_proxy などの環境変数から取得
します。適切なプロキシが見つからない場合は nil を返します。

環境変数は大文字にしたもの(HTTP_PROXY, FTP_PROXY, NO_PROXYなど)も調べら
れる事に注意してください。

ただし、CGI環境下では http_proxy と HTTP_PROXY は特別扱いされます。
HTTP_PROXY はヘッダ Proxy: に設定されうるためです。そのため、
HTTP_PROXY(環境変数が大文字小文字を区別しない場合は http...

URI::Generic#fragment -> String | nil (304.0)

自身の fragment を文字列で返します。設定されていない場合は nil を返します。

自身の fragment を文字列で返します。設定されていない場合は nil を返します。

例:
require 'uri'
u = URI.parse('http://example.com/#frgmt')
p u.fragment #=> "frgmt"

URI::Generic#host -> String | nil (304.0)

自身の host を文字列で返します。設定されていない場合は nil を返します。

...自身の host を文字列で返します。設定されていない場合は nil を返します。

@see URI::Generic#hostname...

絞り込み条件を変える

URI::Generic#hostname -> String | nil (304.0)

自身の hostname を文字列で返します。また、URI::Generic#host が設 定されていない場合は nil を返します。

...自身の hostname を文字列で返します。また、URI::Generic#host が設
定されていない場合は nil を返します。

このメソッドは URI::Generic#host に IPv6 アドレスが設定されていた
場合はブラケットを削除した文字列を返しますがそれ以...

URI::Generic#merge!(rel) -> self (304.0)

与えられたパス rel を自身へ連結します。

与えられたパス rel を自身へ連結します。

2396 の Section 5.2 の仕様に従います。
rel が文字列の場合は URI.parse(rel) によって、URI に変換してから連結します。

@param rel 連結したいパスを文字列か URI オブジェクトで与えます。

例:
require 'uri'
u = URI.parse('http://example.com/')
u.merge!('/foo/bar.html')
p u.to_s #=> http://example.co...

URI::Generic#merge(rel) -> URI::Generic (304.0)

自身と与えられたパス rel を連結した新しい URI オブジェクトを生成して返します。

自身と与えられたパス rel を連結した新しい URI オブジェクトを生成して返します。

3986 の Section 5.2 の仕様に従います。
rel が文字列の場合は URI.parse(rel) によって、URI に変換してから連結します。


@param rel 連結したいパスを文字列か URI オブジェクトで与えます。

例:
require 'uri'
p URI.parse('http://example.com/') + '/foo/bar.html'
#=> #<URI::HTTP:0x201001c0 URL:http://example.com/foo...

URI::Generic#opaque -> String | nil (304.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 (304.0)

自身の password を文字列で返します。設定されていない場合は nil を返します。

自身の password を文字列で返します。設定されていない場合は nil を返します。

絞り込み条件を変える

URI::Generic#path -> String | nil (304.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 (304.0)

自身の port を文字列で返します。設定されていない場合は nil を返します。

自身の port を文字列で返します。設定されていない場合は nil を返します。

URI::Generic#query -> String | nil (304.0)

自身の query を文字列で返します。設定されていない場合は nil を返します。

自身の query を文字列で返します。設定されていない場合は nil を返します。

例:
require 'uri'
p URI.parse('http://example.com/?hoge').query #=> "hoge"

URI::Generic#registry -> String | nil (304.0)

自身の registry を文字列で返します。設定されていない場合は nil を返します。

自身の registry を文字列で返します。設定されていない場合は nil を返します。

URI::Generic#scheme -> String | nil (304.0)

自身の scheme を文字列で返します。設定されていない場合は nil を返します。

自身の scheme を文字列で返します。設定されていない場合は nil を返します。

絞り込み条件を変える

URI::Generic#user -> String | nil (304.0)

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

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

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

URI::Generic#userinfo -> String | nil (304.0)

自身の userinfo を "username:password" という形式の文字列で返します。 設定されていない場合は nil を返します。

自身の userinfo を "username:password" という形式の文字列で返します。
設定されていない場合は nil を返します。

URI::Generic.component -> [Symbol] (304.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.new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, parser = URI::DEFAULT_PARSER, arg_check = false) -> URI::Generic (304.0)

各引数を成分とする URI::Generic オブジェクトを生成して返します。

...各引数を成分とする URI::Generic オブジェクトを生成して返します。

@param scheme 構成要素 scheme を表す文字列を与えます。

@param userinfo 構成要素を表す文字列を与えます。

@param host 構成要素を表す文字列を与えます。

@param p...

URI::Generic.use_registry -> bool (304.0)

構成要素 registry を受け付けるなら true を返します。 URI::Generic クラスでは false です。

...構成要素 registry を受け付けるなら true を返します。
URI::Generic
クラスでは false です。...

絞り込み条件を変える

URI::Generic::COMPONENT -> [Symbol] (304.0)

URI::Generic で利用可能なコンポーネントの一覧です。

...
URI::Generic
で利用可能なコンポーネントの一覧です。...