33件ヒット
[1-33件を表示]
(0.057秒)
検索結果
先頭3件
-
URI
. parse(uri _ str) -> object (3108.0) -
与えられた URI から該当する URI::Generic のサブクラスのインスタンスを生成して 返します。scheme が指定されていない場合は、URI::Generic オブジェクトを返します。
... URI から該当する URI::Generic のサブクラスのインスタンスを生成して
返します。scheme が指定されていない場合は、URI::Generic オブジェクトを返します。
@param uri_str パースしたい URI を文字列として与えます。
@raise URI::InvalidC......@raise URI::InvalidURIError パースに失敗した場合に発生します。
例:
require 'uri'
p uri = URI.parse("http://www.ruby-lang.org/")
# => #<URI::HTTP:0x201002a6 URL:http://www.ruby-lang.org/>
p uri.scheme # => "http"
p uri.host # => "www.ruby-lang.org"
p uri.port......# => 80
p uri.path # => "/"... -
URI
:: Generic # coerce(oth) -> [URI , URI] (3108.0) -
引数 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.ex... -
URI
:: Generic # select(*components) -> [String] (3108.0) -
指定された 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"]...