るりまサーチ

最速Rubyリファレンスマニュアル検索!
93件ヒット [1-93件を表示] (0.088秒)

別のキーワード

  1. stringio set_encoding
  2. _builtin set_encoding
  3. _builtin encoding
  4. rss encoding
  5. rss encoding=

ライブラリ

クラス

モジュール

キーワード

検索結果

Net::HTTPHeader#each {|name, val| .... } -> () (18115.0)

保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。

...mlist[例][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 = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}...

Net::HTTPHeader#each_header {|name, val| .... } -> () (6115.0)

保持しているヘッダ名とその値をそれぞれ ブロックに渡して呼びだします。

...mlist[例][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 = gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => accept = */*
# => user-agent = Ruby
//}...

Net::HTTPHeader#each_key {|name| ... } -> () (6115.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| ... } -> () (6115.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| .... } -> () (6114.0)

保持しているヘッダ名を正規化 ('x-my-header' -> 'X-My-Header') して、ブロックに渡します。

...er' -> '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
//}...

絞り込み条件を変える

Array#pack(template) -> String (31.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...HSElKS0xNTk9QUVJTVFVWV1hZWg==".unpack("m0")
# => ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
//}
@see base64

: M

quoted-printable encoding された文字列
//emlist[][ruby]{
["a b c\td \ne"].pack("M") # => "a b c\td =\n\ne=\n"

"a b c\td =\n\ne=\n".unpack("M") # => ["a b c\td \ne"...
...ビットはどこまでデータがあ
るかを示している)。

ISO/IEC 8825-1:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。

//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("...
...121].pack("cccc") # => "Ruby"
[82, 117, 98, 121].pack("c4") # => "Ruby"
[82, 117, 98, 121].pack("c*") # => "Ruby"

s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"

[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"

[82, 117, 98, 121].inject("") {|s, c| s << c}...

Array#pack(template, buffer: String.new) -> String (31.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...HSElKS0xNTk9QUVJTVFVWV1hZWg==".unpack("m0")
# => ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
//}
@see base64

: M

quoted-printable encoding された文字列
//emlist[][ruby]{
["a b c\td \ne"].pack("M") # => "a b c\td =\n\ne=\n"

"a b c\td =\n\ne=\n".unpack("M") # => ["a b c\td \ne"...
...ビットはどこまでデータがあ
るかを示している)。

ISO/IEC 8825-1:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。

//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("...
...121].pack("cccc") # => "Ruby"
[82, 117, 98, 121].pack("c4") # => "Ruby"
[82, 117, 98, 121].pack("c*") # => "Ruby"

s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"

[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"

[82, 117, 98, 121].inject("") {|s, c| s << c}...

String#unpack(template) -> Array (31.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...HSElKS0xNTk9QUVJTVFVWV1hZWg==".unpack("m0")
# => ["abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"]
//}
@see base64

: M

quoted-printable encoding された文字列
//emlist[][ruby]{
["a b c\td \ne"].pack("M") # => "a b c\td =\n\ne=\n"

"a b c\td =\n\ne=\n".unpack("M") # => ["a b c\td \ne"...
...ビットはどこまでデータがあ
るかを示している)。

ISO/IEC 8825-1:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。

//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("...
...121].pack("cccc") # => "Ruby"
[82, 117, 98, 121].pack("c4") # => "Ruby"
[82, 117, 98, 121].pack("c*") # => "Ruby"

s = ""
[82, 117, 98, 121].each {|c| s << c}
s # => "Ruby"

[82, 117, 98, 121].collect {|c| sprintf "%c", c}.join # => "Ruby"

[82, 117, 98, 121].inject("") {|s, c| s << c}...