4件ヒット
[1-4件を表示]
(0.049秒)
種類
- インスタンスメソッド (2)
- ライブラリ (1)
- 文書 (1)
ライブラリ
- open-uri (2)
モジュール
-
OpenURI
:: Meta (2)
キーワード
-
content
_ encoding (1) - open-uri (1)
- 正規表現 (1)
検索結果
-
OpenURI
:: Meta # meta -> Hash (63340.0) -
ヘッダを収録したハッシュを返します。
ヘッダを収録したハッシュを返します。
//emlist[例][ruby]{
require 'open-uri'
URL.open('http://example.com/') {|f|
p f.meta
#=> {"date"=>"Sun, 04 May 2008 11:26:40 GMT",
# "content-type"=>"text/html;charset=utf-8",
# "server"=>"Apache/2.0.54 (Debian GNU/Linux) mod_ssl/2.0.54 OpenSSL/0.9.7e",
# "tran... -
OpenURI
:: Meta # content _ encoding -> [String] (27418.0) -
対象となるリソースの Content-Encoding を文字列の配列として返します。 Content-Encoding ヘッダがない場合は、空の配列を返します。
対象となるリソースの Content-Encoding を文字列の配列として返します。
Content-Encoding ヘッダがない場合は、空の配列を返します。
例:
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://example.com/f.tar.gz') {|f|
p f.content_encoding #=> ["x-gzip"]
}
//} -
正規表現 (355.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
正規表現
* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は文字列のパタ... -
open-uri (55.0)
-
http/ftp に簡単にアクセスするためのクラスです。
http/ftp に簡単にアクセスするためのクラスです。
=== 使用例
http/ftp の URL を、普通のファイルのように開けます。
require 'open-uri'
URI.open("http://www.ruby-lang.org/") {|f|
f.each_line {|line| p line}
}
開いたファイルオブジェクトは StringIO もしくは Tempfile で
すが OpenURI::Meta モジュールで拡張されていて、メタ情報を獲得する
メソッドが使えます。
require 'open-uri'
URI.ope...