9件ヒット
[1-9件を表示]
(0.097秒)
ライブラリ
-
net
/ http (6) -
rexml
/ document (2) -
webrick
/ httputils (1)
クラス
モジュール
-
Net
:: HTTPHeader (6)
キーワード
-
each
_ attribute (1) -
each
_ capitalized _ name (1) -
each
_ data (1) -
each
_ header (1) -
each
_ key (1) -
each
_ name (1) -
each
_ value (1)
検索結果
先頭5件
-
Net
:: HTTPHeader # each {|name , val| . . . . } -> () (63400.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
保持しているヘッダ名とその値をそれぞれ
ブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-encoding... -
REXML
:: Attributes # each {|name , value| . . . } -> () (54379.0) -
各属性の名前と値に対しブロックを呼び出します。
各属性の名前と値に対しブロックを呼び出します。
名前には expanded_name(REXML::Namespace#exapnded_name)が
渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a... -
Net
:: HTTPHeader # each _ header {|name , val| . . . . } -> () (27400.0) -
保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。
保持しているヘッダ名とその値をそれぞれ
ブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
val は ", " で連結した文字列がブロックに渡されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_header { |key,value| puts "#{key} = #{value}" }
# => accept-encoding... -
Net
:: HTTPHeader # each _ key {|name| . . . } -> () (27400.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
保持しているヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-encoding
# => accept
# => user-agent
//} -
Net
:: HTTPHeader # each _ name {|name| . . . } -> () (27400.0) -
保持しているヘッダ名をブロックに渡して呼びだします。
保持しているヘッダ名をブロックに渡して呼びだします。
ヘッダ名は小文字で統一されます。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_name { |name| puts name }
# => accept-encoding
# => accept
# => user-agent
//} -
Net
:: HTTPHeader # each _ capitalized _ name {|name| . . . . } -> () (27397.0) -
保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。
保持しているヘッダ名を正規化
('x-my-header' -> 'X-My-Header')
して、ブロックに渡します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_capitalized_name { |key| puts key }
# => Accept-Encoding
# => Accept
# => User-Agent
//} -
Net
:: HTTPHeader # each _ value {|value| . . . . } -> () (27397.0) -
保持しているヘッダの値をブロックに渡し、呼びだします。
保持しているヘッダの値をブロックに渡し、呼びだします。
渡される文字列は ", " で連結したものです。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_value { |value| puts value }
# => gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => */*
# => Ruby
//} -
WEBrick
:: HTTPUtils :: FormData # each _ data {|s| . . . } (27343.0) -
自身が表す各フォームデータを引数として、与えられたブロックを実行します。
自身が表す各フォームデータを引数として、与えられたブロックを実行します。
例:
require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
req.query['q'].each_data{|s|
p s
}
#=> "val1"
"val2"
"val3"
end
end
MyCGI.new.start() -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (18415.0) -
各属性に対しブロックを呼び出します。
各属性に対しブロックを呼び出します。
個々の属性は REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root...