294件ヒット
[1-100件を表示]
(0.140秒)
ライブラリ
- ビルトイン (69)
-
cgi
/ html (22) - digest (11)
-
net
/ http (11) - nkf (11)
- openssl (11)
-
rdoc
/ code _ object (22) - stringio (22)
- uri (11)
-
webrick
/ httpstatus (88)
クラス
-
ARGF
. class (22) - IO (22)
-
Net
:: HTTPResponse (11) -
OpenSSL
:: Config (11) -
RDoc
:: CodeObject (22) - Refinement (3)
- String (22)
- StringIO (22)
-
URI
:: FTP (11)
モジュール
-
CGI
:: HtmlExtension (22) - Digest (11)
-
WEBrick
:: HTTPStatus (88)
キーワード
-
NEWS for Ruby 3
. 0 . 0 (4) - NKF (11)
- [] (11)
-
client
_ error? (11) -
document
_ children (11) -
document
_ children= (11) - each (11)
-
each
_ codepoint (88) - error? (11)
- form (22)
- hexencode (11)
-
import
_ methods (3) - info? (11)
- new2 (11)
- rake (11)
-
reason
_ phrase (11) - redirect? (11)
-
server
_ error? (11) - success? (11)
-
test
/ unit (1)
検索結果
先頭5件
-
String
# each _ codepoint {|codepoint| block } -> self (21500.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
StringIO
# each _ codepoint {|codepoint| . . . } -> self (21500.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
String
# each _ codepoint -> Enumerator (21300.0) -
文字列の各コードポイントに対して繰り返します。
...ます。
//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
"hello わーるど".encode('euc-jp').each_codepoint.to_a
# => [104, 101, 108, 108, 111, 32, 42223, 41404, 42219, 42185]
//}
@see String#codepoints... -
StringIO
# each _ codepoint -> Enumerator (21300.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
Net
:: HTTPResponse # code -> String (21207.0) -
HTTP のリザルトコードです。例えば '302' などです。
...
HTTP のリザルトコードです。例えば '302' などです。
この値を見ることでレスポンスの種類を判別できますが、
レスポンスオブジェクトがどのクラスのインスタンスかを
見ることでもレスポンスの種類を判別できます。
//......emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.code # => "200"
//}... -
StringIO
# each _ codepoint {|codepoint| . . . } -> self (18500.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
IO
# each _ codepoint -> Enumerator (18312.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...
IO の各コードポイントに対して繰り返しブロックを呼びだします。
ブロックの引数にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde......あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
IO
# each _ codepoint {|c| . . . } -> self (18312.0) -
IO の各コードポイントに対して繰り返しブロックを呼びだします。
...
IO の各コードポイントに対して繰り返しブロックを呼びだします。
ブロックの引数にはコードポイントを表す整数が渡されます。
ブロックを省略した場合には、Enumerator を返します。
//emlist[例][ruby]{
IO.write("testfile", "abcde......あ")
File.open("testfile") do |f|
f.each_codepoint { |i| p i }
end
# => 97
# 98
# 99
# 100
# 101
# 12354
//}... -
ARGF
. class # each _ codepoint -> Enumerator (18300.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...umerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (18300.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...umerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,108... -
StringIO
# each _ codepoint -> Enumerator (18300.0) -
自身の各コードポイントに対して繰り返します。
...自身の各コードポイントに対して繰り返します。
@see IO#each_codepoint... -
Digest
. # hexencode(string) -> String (15400.0) -
引数である文字列 string を、16進数に変換した文字列を生成して返します。
...列 string を、16進数に変換した文字列を生成して返します。
@param string 文字列を指定します。
//emlist[][ruby]{
require 'digest'
p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Digest.hexencode("\xB0")......"b0"
p digest = Digest::MD5.digest("ruby") # => "X\xE5=\x13$\xEE\xF6&_\xDB\x97\xB0\x8E\xD9\xAA\xDF"
p Digest.hexencode(digest) # => "58e53d1324eef6265fdb97b08ed9aadf"
p Digest::MD5.hexdigest("ruby") # => "58e53d1324eef6265fdb97b08ed9aadf"
p digest = Digest::SHA1.digest("rub......B\x81"
p Digest.hexencode(digest) # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
p Digest::SHA1.hexdigest("ruby") # => "18e40e1401eef67e1ae69efab09afb71f87ffb81"
//}
文字列から16進数に変換したハッシュ値を直接得たい場合は、Digest::Base.hexdigest を...