ライブラリ
- ビルトイン (39)
- bigdecimal (1)
- date (7)
- fiddle (2)
-
fiddle
/ import (4) - ipaddr (1)
- mkmf (8)
-
net
/ http (2) -
net
/ imap (7) - openssl (3)
- optparse (1)
- prettyprint (6)
- psych (8)
- resolv (2)
-
rexml
/ document (1) -
rinda
/ tuplespace (1) -
rubygems
/ commands / dependency _ command (1) -
rubygems
/ dependency (1) -
rubygems
/ package / tar _ reader / entry (2) -
shell
/ system-command (1) - socket (12)
- stringio (1)
- win32ole (3)
- zlib (1)
クラス
-
ARGF
. class (1) - Addrinfo (3)
- Array (25)
- BasicSocket (2)
- BigDecimal (1)
- Date (7)
-
Fiddle
:: Closure (1) -
Fiddle
:: Handle (1) -
Gem
:: Commands :: DependencyCommand (1) -
Gem
:: Dependency (1) -
Gem
:: Package :: TarReader :: Entry (2) - IO (1)
- IPAddr (1)
- Method (1)
-
Net
:: HTTP (2) -
Net
:: IMAP (2) -
Net
:: IMAP :: BodyTypeBasic (1) -
Net
:: IMAP :: BodyTypeMessage (2) -
Net
:: IMAP :: BodyTypeText (2) -
OpenSSL
:: PKey :: EC :: Group (1) -
OpenSSL
:: SSL :: SSLContext (2) - OptionParser (1)
- PrettyPrint (6)
-
Psych
:: Emitter (2) -
Psych
:: Nodes :: Document (1) -
Psych
:: Nodes :: Mapping (1) -
Psych
:: Nodes :: Scalar (1) -
Psych
:: Nodes :: Sequence (1) -
Psych
:: Nodes :: Stream (1) -
Psych
:: Parser :: Mark (1) -
REXML
:: Formatters :: Pretty (1) -
Resolv
:: DNS :: Resource :: IN :: SRV (1) -
Resolv
:: DNS :: Resource :: SOA (1) -
Rinda
:: TupleEntry (1) -
Shell
:: SystemCommand (1) -
Socket
:: AncillaryData (7) - String (3)
- StringIO (1)
- Thread (1)
- Time (4)
- TracePoint (2)
- UnboundMethod (1)
- WIN32OLE (1)
-
WIN32OLE
_ METHOD (1) -
WIN32OLE
_ TYPE (1) -
Zlib
:: ZStream (1)
モジュール
-
Fiddle
:: Importer (4) - Kernel (8)
キーワード
- <=> (1)
- [] (3)
- []= (3)
- afamily (1)
- arity (2)
- at (1)
- bind (1)
- breakable (1)
-
bsearch
_ index (1) -
bytes
_ read (1) -
callee
_ id (1) -
check
_ signedness (2) -
check
_ sizeof (2) -
convertible
_ int (2) -
create
_ value (1) - ctype (1)
- cwday (1)
- cwyear (1)
-
data
_ type (1) - day (2)
- degree (1)
-
delete
_ at (1) - encoding (1)
- family (2)
-
find
_ index (2) - getbyte (1)
- group (1)
-
import
_ symbol (1) - indent (1)
- indentation (1)
- index (3)
-
ip
_ pktinfo (1) -
ipv6
_ pktinfo (1) -
ipv6
_ pktinfo _ ifindex (1) - kill (1)
- level (1)
-
line
_ width (1) - lines (2)
- maxwidth (1)
- mday (2)
-
method
_ id (1) - nest (1)
-
ole
_ query _ interface (1) - pack (2)
- pfamily (1)
- pos (1)
-
print
_ dependencies (1) - priority (2)
- readbyte (3)
- recvmsg (1)
-
recvmsg
_ nonblock (1) -
repeated
_ combination (2) -
repeated
_ permutation (2) - retry (1)
-
return
_ vtype (1) - rindex (2)
- rotate (1)
- rotate! (1)
- sample (2)
- setbyte (1)
- size (4)
- socktype (1)
- split (1)
- style (3)
-
summary
_ width (1) - sym (1)
- text (1)
-
try
_ constant (2) - type (1)
- typekind (1)
-
uid
_ search (1) -
uid
_ sort (1) - unpack (1)
- value (1)
-
verify
_ depth (2) -
verify
_ mode (2) - version (1)
- wday (2)
- width (1)
- yday (2)
- year (1)
検索結果
先頭5件
-
Socket
:: AncillaryData # int -> Integer (72679.0) -
自身が保持している cmsg data (データ) を整数の形で返します。
自身が保持している cmsg data (データ) を整数の形で返します。
整数データのサイズおよびエンディアンは実行するホストによって異なります。
require 'socket'
ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
p ancdata.int #=> 2
@raise TypeError cmgs data のサイズが int のバイト数と異なる場合に発生します
@see Socket::AncillaryData.new Socket::Ancillar... -
Gem
:: Commands :: DependencyCommand # print _ dependencies(spec , level = 0) -> String (54904.0) -
依存関係を表す文字列を返します。
依存関係を表す文字列を返します。
@param spec Gem::Specification のインスタンスを指定します。
@param level 依存関係の深さを指定します。 -
Date
# cwday -> Integer (45904.0) -
暦週の日 (曜日) を返します (1-7、月曜は1)。
暦週の日 (曜日) を返します (1-7、月曜は1)。 -
Date
# day -> Integer (45904.0) -
月の日を返します (1-31)。
月の日を返します (1-31)。 -
Date
# mday -> Integer (45904.0) -
月の日を返します (1-31)。
月の日を返します (1-31)。 -
Date
# wday -> Integer (45904.0) -
曜日を返します (0-6、日曜日は零)。
曜日を返します (0-6、日曜日は零)。 -
Date
# yday -> Integer (45904.0) -
年の日を返します (1-366)。
年の日を返します (1-366)。 -
WIN32OLE
_ TYPE # typekind -> Integer (45904.0) -
selfの種類を示す値を取得します。
selfの種類を示す値を取得します。
値の意味については、WIN32OLE_TYPE#ole_typeを参照してください。
@return 型の種類を示す数値を返します。
@raise WIN32OLERuntimeError 型の種類(TYPEKIND)を取得できない場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Word 14.0 Object Library', 'Documents')
p tobj.typekind # => 4
@see WIN32OLE_TYPE#ole_type -
WIN32OLE
# ole _ query _ interface(iid) -> WIN32OLE (36940.0) -
IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを 持つオブジェクトを取得します。
IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを
持つオブジェクトを取得します。
オブジェクトが複数のオートメーション用インターフェイスを持つ場合に、当
メソッドを利用して既定のインターフェイスとは異なるインターフェイスを取
得します。
@param iid 取得するインターフェイスのIIDを文字列で指定します。
@return iidパラメータで指定したインターフェイスを持つWIN32OLEオブジェクト
@raise WIN32OLERuntimeError 指定したIIDをオブジェクトが持たない場合に通知されます。
ie = WIN32OLE.n... -
ARGF
. class # readbyte -> Integer (36904.0) -
自身から 1 バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。
自身から 1 バイトを読み込み整数として返します。
既に EOF に達していれば EOFError が発生します。
@raise EOFError 既に EOF に達している場合に発生します。
$ echo "foo" > file
$ ruby argf.rb file
ARGF.readbyte # => 102
ARGF.readbyte # => 111
ARGF.readbyte # => 111
ARGF.readbyte # => 10
ARGF.readbyte # => end of file reached (EOFError)... -
Gem
:: Package :: TarReader :: Entry # bytes _ read -> Integer (36904.0) -
自身から読み込んだバイト数を返します。
自身から読み込んだバイト数を返します。 -
IO
# readbyte -> Integer (36904.0) -
IO から1バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。
IO から1バイトを読み込み整数として返します。
既に EOF に達していれば EOFError が発生します。
@raise EOFError 既に EOF に達している場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "123")
File.open("testfile") do |f|
begin
f.readbyte # => 49
f.readbyte # => 50
f.readbyte # => 51
f.readbyte # => 例外発生
rescue => e
e... -
Net
:: HTTP # verify _ depth -> Integer (36904.0) -
証明書チェイン上の検証する最大の深さを返します。
証明書チェイン上の検証する最大の深さを返します。
@see Net::HTTP#verify_depth=, OpenSSL::SSL::SSLContext#verify_depth -
Net
:: HTTP # verify _ mode -> Integer | nil (36904.0) -
検証モードを返します。
検証モードを返します。
デフォルトは nil です。 -
OpenSSL
:: SSL :: SSLContext # verify _ depth -> Integer | nil (36904.0) -
証明書チェイン上の検証する最大の深さを返します。
証明書チェイン上の検証する最大の深さを返します。
デフォルトは nil です。
@see OpenSSL::SSL::SSLContext#verify_depth= -
OpenSSL
:: SSL :: SSLContext # verify _ mode -> Integer | nil (36904.0) -
検証モードを返します。
検証モードを返します。
デフォルトは nil です。
@see OpenSSL::SSL::SSLContext#verify_mode= -
OptionParser
# summary _ width -> Integer (36904.0) -
サマリを表示するときの幅を整数で返します。
サマリを表示するときの幅を整数で返します。
@return サマリを表示するときの幅を整数で返します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " ... -
StringIO
# readbyte -> Integer (36904.0) -
自身から 1 文字読み込んで、その文字に対応する整数を返します。
自身から 1 文字読み込んで、その文字に対応する整数を返します。
文字列の終端に到達した時には例外 EOFError を発生させます。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.readbyte #=> 104
//}
@raise EOFError 文字列の終端に到達した時に発生します。 -
Time
# day -> Integer (36904.0) -
日を整数で返します。
日を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//} -
Time
# mday -> Integer (36904.0) -
日を整数で返します。
日を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//} -
Time
# wday -> Integer (36904.0) -
曜日を0(日曜日)から6(土曜日)の整数で返します。
曜日を0(日曜日)から6(土曜日)の整数で返します。
//emlist[][ruby]{
p sun = Time.new(2017, 9, 17, 10, 34, 15, '+09:00') # => 2017-09-17 10:34:15 +0900
p sun.wday # => 0
p mon = Time.new(2017, 9, 18, 10, 34, 15, '+09:00') # => 2017-09-18 10:34:15 +0900
p mon.wday ... -
Time
# yday -> Integer (36904.0) -
1月1日を1とした通算日(1から366まで)を整数で返します。
1月1日を1とした通算日(1から366まで)を整数で返します。
//emlist[][ruby]{
p Time.mktime(2000, 1, 1).yday # => 1
//}
うるう年の場合は、2月29日も含めた通算日を返します。
//emlist[うるう年でない場合][ruby]{
p Time.mktime(2003, 1, 1).yday # => 1
p Time.mktime(2003, 3, 1).yday # => 60
p Time.mktime(2003, 12, 31).yday # => 365
//}
//emlist[うるう年の場合][r... -
Zlib
:: ZStream # data _ type -> Integer (36904.0) -
ストリームに入力されたデータの形式を推測します。 返り値は Zlib::BINARY, Zlib::ASCII, Zlib::UNKNOWN の いずれかです。
ストリームに入力されたデータの形式を推測します。
返り値は Zlib::BINARY, Zlib::ASCII, Zlib::UNKNOWN の
いずれかです。 -
PrettyPrint
# indent -> Integer (36604.0) -
現在のインデントの深さを返します。
現在のインデントの深さを返します。 -
PrettyPrint
# maxwidth -> Integer (36604.0) -
自身の幅を返します。
自身の幅を返します。 -
Fiddle
:: Importer # import _ symbol(name) -> Fiddle :: Pointer (27904.0) -
取り込んだライブラリからシンボルをインポートします。
取り込んだライブラリからシンボルをインポートします。
返り値はシンボルがロードされたメモリのアドレスを持つ Fiddle::Pointer
オブジェクトを返します。
@param name シンボル名(文字列) -
Method
# arity -> Integer (27658.0) -
メソッドが受け付ける引数の数を返します。
メソッドが受け付ける引数の数を返します。
ただし、メソッドが可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。C 言語レベルで実装されたメソッドが可変長引数を
受け付ける場合、-1 を返します。
//emlist[例][ruby]{
class C
def u; end
def v(a); end
def w(*a); end
def x(a, b); end
def y(a, b, *c); end
def z(a, b, *... -
UnboundMethod
# arity -> Integer (27622.0) -
メソッドが受け付ける引数の数を返します。
メソッドが受け付ける引数の数を返します。
ただし、メソッドが可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。C 言語レベルで実装されたメソッドが可変長引数を
受け付ける場合、-1 を返します。
//emlist[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end
p C.insta... -
Addrinfo
# afamily -> Integer (27604.0) -
アドレスファミリーを整数で返します。
アドレスファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).afamily == Socket::AF_INET #=> true -
Addrinfo
# pfamily -> Integer (27604.0) -
プロトコルファミリーを整数で返します。
プロトコルファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).pfamily == Socket::PF_INET #=> true -
Addrinfo
# socktype -> Integer (27604.0) -
ソケットタイプを整数で返します。
ソケットタイプを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true -
Array
# bsearch _ index { |x| . . . } -> Integer | nil (27604.0) -
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。
ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を
二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil
を返します。self はあらかじめソートしておく必要があります。
本メソッドはArray#bsearchと同様に、ブロックを評価した結果により2
つのモードで動作します。Array#bsearch との違いは見つかった要素自
身を返すか位置を返すかのみです。各モードのより詳細な違いについては
Array#bsearch を参照してください。
//emlist[例: find-minimum モード][ruby]{
ary = [0,... -
Array
# find _ index {|item| . . . } -> Integer | nil (27604.0) -
条件に一致する最初の要素の位置を返します。
条件に一致する最初の要素の位置を返します。
@param val 位置を知りたいオブジェクトを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初... -
Array
# find _ index(val) -> Integer | nil (27604.0) -
条件に一致する最初の要素の位置を返します。
条件に一致する最初の要素の位置を返します。
@param val 位置を知りたいオブジェクトを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初... -
Array
# index {|item| . . . } -> Integer | nil (27604.0) -
条件に一致する最初の要素の位置を返します。
条件に一致する最初の要素の位置を返します。
@param val 位置を知りたいオブジェクトを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初... -
Array
# index(val) -> Integer | nil (27604.0) -
条件に一致する最初の要素の位置を返します。
条件に一致する最初の要素の位置を返します。
@param val 位置を知りたいオブジェクトを指定します。
指定された val と == で等しい最初の要素の位置を返します。
等しい要素がひとつもなかった場合は nil を返します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].index(1) #=> 0
p [1, 0, 0, 0, 0].index(1) #=> 0
p [0, 0, 0, 0, 0].index(1) #=> nil
//}
ブロックが与えられた場合には、各要素を引数として順にブロックを実行し、
ブロックが真を返した最初... -
Array
# rindex {|item| . . . } -> Integer | nil (27604.0) -
指定された val と == で等しい最後の要素の位置を返します。 等しい要素がひとつもなかった時には nil を返します。
指定された val と == で等しい最後の要素の位置を返します。
等しい要素がひとつもなかった時には nil を返します。
ブロックが与えられた時には、各要素を右(末尾)から順に引数としてブロックを実行し、
ブロックが真を返す最初の要素の位置を返します。
ブロックが真を返す要素がなかった時には nil を返します。
引数、ブロックのどちらも与えられなかった時には、自身と rindex から生成した
Enumerator オブジェクトを返します。
@param val オブジェクトを指定します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].rindex(... -
Array
# rindex(val) -> Integer | nil (27604.0) -
指定された val と == で等しい最後の要素の位置を返します。 等しい要素がひとつもなかった時には nil を返します。
指定された val と == で等しい最後の要素の位置を返します。
等しい要素がひとつもなかった時には nil を返します。
ブロックが与えられた時には、各要素を右(末尾)から順に引数としてブロックを実行し、
ブロックが真を返す最初の要素の位置を返します。
ブロックが真を返す要素がなかった時には nil を返します。
引数、ブロックのどちらも与えられなかった時には、自身と rindex から生成した
Enumerator オブジェクトを返します。
@param val オブジェクトを指定します。
//emlist[例][ruby]{
p [1, 0, 0, 1, 0].rindex(... -
Date
# cwyear -> Integer (27604.0) -
暦週における年を返します。
暦週における年を返します。 -
Date
# year -> Integer (27604.0) -
年を返します。
年を返します。 -
Fiddle
:: Closure # ctype -> Integer (27604.0) -
返り値の型を返します。
返り値の型を返します。 -
IPAddr
# family -> Integer (27604.0) -
このオブジェクトのアドレスファミリを返します。
このオブジェクトのアドレスファミリを返します。
@see Socket -
OpenSSL
:: PKey :: EC :: Group # degree -> Integer (27604.0) -
群の定義の元となっている体の要素を 表現するのに必要なビット数を返します。
群の定義の元となっている体の要素を
表現するのに必要なビット数を返します。 -
Psych
:: Emitter # indentation -> Integer (27604.0) -
インデントのレベルを返します。
インデントのレベルを返します。
@see Psych::Emitter#indentation= -
Psych
:: Emitter # line _ width -> Integer (27604.0) -
「好ましい」行幅を返します。
「好ましい」行幅を返します。
@see Psych::Emitter#line_width= -
Psych
:: Nodes :: Mapping # style -> Integer (27604.0) -
mapping の style を返します。
mapping の style を返します。
@see Psych::Nodes::Mapping#style=,
Psych::Nodes::Mapping.new -
Psych
:: Nodes :: Scalar # style -> Integer (27604.0) -
scalar の style を返します。
scalar の style を返します。
@see Psych::Nodes::Scalar#style=,
Psych::Nodes::Scalar.new -
Psych
:: Nodes :: Sequence # style -> Integer (27604.0) -
sequence の style を返します。
sequence の style を返します。
@see Psych::Nodes::Sequence#style=,
Psych::Nodes::Sequence.new -
Psych
:: Nodes :: Stream # encoding -> Integer (27604.0) -
stream に使われるエンコーディングを返します。
stream に使われるエンコーディングを返します。
@see Psych::Nodes::Stream#encoding= -
Psych
:: Parser :: Mark # index -> Integer (27604.0) -
先頭からの文字数。
先頭からの文字数。 -
REXML
:: Formatters :: Pretty # width -> Integer (27604.0) -
出力のページ幅を返します。
出力のページ幅を返します。
デフォルトは80です。
@see REXML::Formatters::Pretty#width= -
Resolv
:: DNS :: Resource :: IN :: SRV # priority -> Integer (27604.0) -
ホストの優先順位を返します。
ホストの優先順位を返します。
クライアントは利用可能なホストの中で最も priority が
小さい数値のホストを利用しなければなりません。
priority が同じならば Resolv::DNS::Resource::IN::SRV#weight
で定義されるようにホストを選ぶべきです。
返り値の範囲は 0 から 65535 までの整数値です。 -
Resolv
:: DNS :: Resource :: SOA # retry -> Integer (27604.0) -
セカンダリサーバがプライマリサーバからの情報更新に失敗した場合に 何秒後にリトライするかを返します。
セカンダリサーバがプライマリサーバからの情報更新に失敗した場合に
何秒後にリトライするかを返します。 -
Socket
:: AncillaryData # family -> Integer (27604.0) -
自身が保持している socket family を返します。
自身が保持している socket family を返します。
require 'socket'
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").family
#=> 10
@see Socket::AncillaryData.new -
Socket
:: AncillaryData # ipv6 _ pktinfo _ ifindex -> Integer (27604.0) -
自身の type が IPV6_PKTINFO である場合、保持しているデータ (アドレス、インターフェースのインデックス) のインデックスを返します。
自身の type が IPV6_PKTINFO である場合、保持しているデータ
(アドレス、インターフェースのインデックス)
のインデックスを返します。
require 'socket'
addr = Addrinfo.ip("::1")
ifindex = 0
ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
p ancdata.ipv6_pktinfo_ifindex #=> 0
@see Socket::AncillaryData.ipv6_pktinfo,
Socket::Anc... -
Socket
:: AncillaryData # type -> Integer (27604.0) -
自身が保持している cmsg type (種類) を返します。
自身が保持している cmsg type (種類) を返します。
require 'socket'
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").type
#=> 2
@see Socket::AncillaryData.new -
Thread
# priority -> Integer (27604.0) -
スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。
スレッドの優先度を返します。この値が大きいほど優先度が高くなります。
メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの
priority を引き継ぎます。
@param val スレッドの優先度を指定します。プラットフォームに依存します。
//emlist[例][ruby]{
Thread.current.priority # => 0
count1 = count2 = 0
a = Thread.new do
loop { count1 += 1 }
end
a.priority = -1
b = Thread.new do
... -
TracePoint
# callee _ id -> Symbol | nil (27604.0) -
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。 トップレベルであった場合は nil を返します。
イベントが発生したメソッドの呼ばれた名前を Symbol で返します。
トップレベルであった場合は nil を返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end
trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
e... -
TracePoint
# method _ id -> Symbol | nil (27604.0) -
イベントが発生したメソッドの定義時の名前を Symbol で返します。 トップレベルであった場合は nil を返します。
イベントが発生したメソッドの定義時の名前を Symbol で返します。
トップレベルであった場合は nil を返します。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[][ruby]{
class C
def method_name
end
alias alias_name method_name
end
trace = TracePoint.new(:call) do |tp|
p [tp.method_id, tp.callee_id] # => [:method_name, :alias_name]
e... -
WIN32OLE
_ METHOD # return _ vtype -> Integer (27604.0) -
メソッドの返り値の型を示す数値を取得します。
メソッドの返り値の型を示す数値を取得します。
@return 返り値の型を示す数値(VARENUM)を返します。
@raise WIN32OLERuntimeError メソッドの型情報を取得できなかった場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
method = WIN32OLE_METHOD.new(tobj, 'Visible')
puts method.return_vtype # => 11
VARENUMの定義は、Platfo... -
Array
# delete _ at(pos) -> object | nil (27322.0) -
指定された位置 pos にある要素を取り除きそれを返します。 pos が範囲外であったら nil を返します。
指定された位置 pos にある要素を取り除きそれを返します。
pos が範囲外であったら nil を返します。
Array#at と同様に負のインデックスで末尾から位置を指定するこ
とができます。
@param pos 削除したい要素のインデックスを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる
暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][r... -
Array
# repeated _ combination(n) -> Enumerator (27322.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行
します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emli... -
Array
# repeated _ combination(n) { |c| . . . } -> self (27322.0) -
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行 します。
サイズ n の重複組み合わせをすべて生成し、それを引数としてブロックを実行
します。
得られる組み合わせの順序は保証されません。ブロックなしで呼び出されると、
組み合わせを生成する Enumerator オブジェクトを返します。
@param n 生成される配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emli... -
Array
# repeated _ permutation(n) -> Enumerator (27322.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby... -
Array
# repeated _ permutation(n) { |p| . . . } -> self (27322.0) -
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。
得られる順列の順序は保証されません。ブロックなしで呼び出されると, 順列
を生成する Enumerator オブジェクトを返します。
@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby... -
Gem
:: Dependency # <=>(other) -> Integer (27304.0) -
self と other を Gem::Dependency#name の ASCII コードで比較して self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。
self と other を Gem::Dependency#name の ASCII コードで比較して
self が大きい時には正の整数、等しい時には 0、小さい時には負の整数を返します。 -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (18958.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (18958.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
# try _ constant(const , headers = nil , opt = "") -> Integer | nil (18904.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
Kernel
# try _ constant(const , headers = nil , opt = "") { . . . } -> Integer | nil (18904.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
Net
:: IMAP # uid _ search(keys , charset = nil) -> [Integer] (18904.0) -
UID SEARCH コマンドを送り、条件に合うメッセージの UID を配列で返します。
UID SEARCH コマンドを送り、条件に合うメッセージの UID
を配列で返します。
Net::IMAP#examine もしくは Net::IMAP#select で
指定したメールボックスを検索対象とします。
検索の条件は key に文字列の1次元配列もしくは文字列で渡します。
検索条件は "SUBJECT", "FROM" などを用いることができます。
詳しくは 2060 の 6.4.4 を見てください。
例:
p imap.uid_search(["SUBJECT", "hello"])
#=> [1, 6, 7, 8]
p imap.uid_search([... -
Socket
:: AncillaryData # ip _ pktinfo -> [Addrinfo , Integer , Addrinfo] (18904.0) -
自身の type が IP_PKTINFO である場合、保持しているデータ (アドレス、インターフェースのインデックス、ローカルアドレス) を3要素の配列で返します。
自身の type が IP_PKTINFO である場合、保持しているデータ
(アドレス、インターフェースのインデックス、ローカルアドレス)
を3要素の配列で返します。
IP_PKTINFO は非標準的拡張であり、システムによっては使えない場合があります。
require 'socket'
addr = Addrinfo.ip("127.0.0.1")
ifindex = 0
spec_dest = Addrinfo.ip("127.0.0.1")
ancdata = Socket::AncillaryData.ip_pktinfo(addr, ifindex, spe... -
String
# getbyte(index) -> Integer | nil (18904.0) -
index バイト目のバイトを整数で返します。
index バイト目のバイトを整数で返します。
index に負を指定すると末尾から数えた位置のバイト
を取り出します。
範囲外を指定した場合は nil を返します。
@param index バイトを取り出す位置
//emlist[例][ruby]{
s = "tester"
s.bytes # => [116, 101, 115, 116, 101, 114]
s.getbyte(0) # => 116
s.getbyte(1) # => 101
s.getbyte(-1) # => 114
s.getbyte(6) ... -
String
# setbyte(index , b) -> Integer (18904.0) -
index バイト目のバイトを b に変更します。
index バイト目のバイトを b に変更します。
index に負を指定すると末尾から数えた位置を変更します。
セットした値を返します。
@param index バイトをセットする位置
@param b セットするバイト(0 から 255 までの整数)
@raise IndexError 範囲外に値をセットしようとした場合に発生します。
//emlist[例][ruby]{
s = "Sunday"
s.setbyte(0, 77)
s.setbyte(-5, 111)
s # => "Monday"
//} -
Kernel
# check _ signedness(type , headers = nil , opts = nil) -> "signed" | "unsigned" | nil (18700.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Kernel
# check _ signedness(type , headers = nil , opts = nil) { . . . } -> "signed" | "unsigned" | nil (18700.0) -
Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.
Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.
If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS... -
Fiddle
:: Handle # sym(func) -> Integer (18604.0) -
関数やグローバル変数 func へのポインタを取得し、整数として返します。
関数やグローバル変数 func へのポインタを取得し、整数として返します。
@param func 得たいシンボルの名前を文字列で与えます。
@raise Fiddle::DLError シンボルが見つからなかった時に発生します。
require 'fiddle'
h = Fiddle::Handle.new('libc.so.6')
p h.sym('strlen') # 関数ポインタのアドレスを整数で表示 -
Socket
:: AncillaryData # ipv6 _ pktinfo -> [Addrinfo , Integer] (18604.0) -
自身の type が IPV6_PKTINFO である場合、保持しているデータ (アドレス、インターフェースのインデックス) を2要素の配列で返します。
自身の type が IPV6_PKTINFO である場合、保持しているデータ
(アドレス、インターフェースのインデックス)
を2要素の配列で返します。
IPV6_PKTINFO については 3542 を参照してください。
require 'socket'
addr = Addrinfo.ip("::1")
ifindex = 0
ancdata = Socket::AncillaryData.ipv6_pktinfo(addr, ifindex)
p ancdata.ipv6_pktinfo #=> [#<Addrinfo: ::1>, 0]
@see Socke... -
Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function (18448.0) -
Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。
Ruby のブロックを C の関数で wrap し、その関数をモジュールに
インポートします。
これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。
signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。
opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示することができます。
@return インポートした関数を表す ... -
Gem
:: Package :: TarReader :: Entry # pos -> Integer (18304.0) -
自身から読み込んだバイト数を返します。
自身から読み込んだバイト数を返します。 -
Net
:: IMAP :: BodyTypeBasic # size -> Integer (18304.0) -
ボディのサイズのオクテット数を返します。
ボディのサイズのオクテット数を返します。 -
Net
:: IMAP :: BodyTypeMessage # lines -> Integer (18304.0) -
ボディのテキストの行数を返します。
ボディのテキストの行数を返します。 -
Net
:: IMAP :: BodyTypeMessage # size -> Integer (18304.0) -
ボディのサイズのオクテット数を返します。
ボディのサイズのオクテット数を返します。 -
Net
:: IMAP :: BodyTypeText # lines -> Integer (18304.0) -
ボディの行数を返します。
ボディの行数を返します。 -
Net
:: IMAP :: BodyTypeText # size -> Integer (18304.0) -
ボディのサイズのオクテット数を返します。
ボディのサイズのオクテット数を返します。 -
PrettyPrint
# breakable(sep , width = sep . length) -> () (18304.0) -
「必要ならここで改行出来る」ということを自身に通知します。 もしその位置で改行されなければ、width カラムのテキスト sep が出力の際にそこに挿入されます。
「必要ならここで改行出来る」ということを自身に通知します。
もしその位置で改行されなければ、width カラムのテキスト sep が出力の際にそこに挿入されます。
@param sep 改行が起きなかった場合に挿入されるテキストを文字列で指定します。
@param width テキスト sep は width カラムであると仮定されます。指定されなければ、
sep.length が利用されます。例えば sep が多バイト文字の際に指定する必要があるかも知れません。 -
PrettyPrint
# group(indent = 0 , open _ obj = & # 39;& # 39; , close _ obj = & # 39;& # 39; , open _ width = open _ obj . length , close _ width = close _ obj . length) { . . . } -> () (18304.0) -
与えられたブロックを実行します。 ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても よい同じグループに属すると仮定されます。
与えられたブロックを実行します。
ブロック内で自身に追加される文字列やオブジェクトは、1行にまとめて表示しても
よい同じグループに属すると仮定されます。
もう少し詳しく説明します。pretty printing アルゴリズムはインデントと改行を、
ツリー構造を作ることによって決定します。そして、group メソッドは子ノードの作成と
子ノードのインデントの深さの決定を担当します。
同じノード内で呼ばれた breakable は、改行するならば全て同時に改行します。
@param indent グループのインデントの深さを指定します。
@param open_obj 指定された場合、s... -
PrettyPrint
# nest(indent) { . . . } -> () (18304.0) -
自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
自身の現在のインデントを indent だけ増加させてから、ブロックを実行し、元に戻します。
@param indent インデントの増加分を整数で指定します。 -
PrettyPrint
# text(obj , width = obj . length) -> () (18304.0) -
obj を width カラムのテキストとして自身に追加します。
obj を width カラムのテキストとして自身に追加します。
@param obj 自身に追加するテキストを文字列で指定します。
@param width obj のカラムを指定します。指定されなかった場合、obj.length が利用されます。 -
Psych
:: Nodes :: Document # version -> [Integer] (18304.0) -
YAML ドキュメントのバージョンを返します。
YAML ドキュメントのバージョンを返します。
@see Psych::Nodes::Document#version=,
Psych::Nodes::Document.new -
Rinda
:: TupleEntry # size -> Integer (18304.0) -
タプルのサイズ(配列の要素数/ハッシュテーブルのエントリー数)を返します
タプルのサイズ(配列の要素数/ハッシュテーブルのエントリー数)を返します
@see Rinda::TupleEntry#value -
Shell
:: SystemCommand # kill(signal) -> Integer (18304.0) -
自身のプロセスにシグナルを送ります。
自身のプロセスにシグナルを送ります。
@param signal シグナルを整数かその名前の文字列で指定します。
負の値を持つシグナル(あるいはシグナル名の前に-)を指定すると、
プロセスではなくプロセスグループにシグナルを送ります。
@see Process.#kill -
Socket
:: AncillaryData # level -> Integer (18304.0) -
自身が保持している cmsg level (元プロトコル) を返します。
自身が保持している cmsg level (元プロトコル) を返します。
require 'socket'
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").level
#=> 41
@see Socket::AncillaryData.new -
Net
:: IMAP # uid _ sort(sort _ keys , search _ keys , charset) -> [Integer] (10204.0) -
SORT コマンド送り、メールボックス内の メッセージをソートした結果を返します。
SORT コマンド送り、メールボックス内の
メッセージをソートした結果を返します。
SORT コマンドは 5256 で定義されています。
詳しくはそちらを参照してください。
このコマンドは Net::IMAP#capability の返り値を見ることで
利用可能かどうか判断できます。
sort_keys にはソート順を決めるキーを文字列の配列で指定します。
"ARRIVAL", "CC", "FROM", "TO", "SUBJECT" などが指定できます。
詳しくは 5265 の BASE.6.4.SORT の所を見てください。
search_key には検索条件を渡します。Net::... -
BigDecimal
# split -> [Integer , String , Integer , Integer] (9958.0) -
BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、 符号 (NaNのときは 0、それ以外は+1か-1になります)、 仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。
BigDecimal 値を 0.xxxxxxx*10**n と表現したときに、
符号 (NaNのときは 0、それ以外は+1か-1になります)、
仮数部分の文字列("xxxxxxx")と、基数(10)、更に指数 n を配列で返します。
//emlist[][ruby]{
require "bigdecimal"
a = BigDecimal("3.14159265")
f, x, y, z = a.split
//}
とすると、f = 1、x = "314159265"、y = 10、z = 1 になります。
従って、以下のようにする事で Float に変換することができます。
//em... -
Array
# sample(n , random: Random) -> Array (9922.0) -
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個) ランダムに選んで返します。
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個)
ランダムに選んで返します。
重複したインデックスは選択されません。そのため、自身がユニークな配列の
場合は返り値もユニークな配列になります。
配列が空の場合、無引数の場合は nil を、個数を指定した場合は空配列を返します。
srand()が有効です。
@param n 取得する要素の数を指定します。自身の要素数(self.length)以上の
値を指定した場合は要素数と同じ数の配列を返します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
... -
Fiddle
:: Importer # create _ value(type , val = nil) -> Fiddle :: CStruct (9640.0) -
型が type で要素名が "value" であるような構造体を 定義(Fiddle::Importer#struct)し、 その構造体のメモリを Fiddle::CStruct#malloc で確保し、 確保したメモリを保持しているオブジェクトを返します。
型が type で要素名が "value" であるような構造体を
定義(Fiddle::Importer#struct)し、
その構造体のメモリを Fiddle::CStruct#malloc で確保し、
確保したメモリを保持しているオブジェクトを返します。
type は "int", "void*" といった文字列で型を指定します。
val に nil 以外を指定すると、確保された構造体に
その値を代入します。
@param type 型を表す文字列
@param val 構造体に確保される初期値
例
require 'fiddle/import'
module M
... -
Fiddle
:: Importer # value(type , val = nil) -> Fiddle :: CStruct (9640.0) -
型が type で要素名が "value" であるような構造体を 定義(Fiddle::Importer#struct)し、 その構造体のメモリを Fiddle::CStruct#malloc で確保し、 確保したメモリを保持しているオブジェクトを返します。
型が type で要素名が "value" であるような構造体を
定義(Fiddle::Importer#struct)し、
その構造体のメモリを Fiddle::CStruct#malloc で確保し、
確保したメモリを保持しているオブジェクトを返します。
type は "int", "void*" といった文字列で型を指定します。
val に nil 以外を指定すると、確保された構造体に
その値を代入します。
@param type 型を表す文字列
@param val 構造体に確保される初期値
例
require 'fiddle/import'
module M
... -
Array
# sample(random: Random) -> object | nil (9622.0) -
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個) ランダムに選んで返します。
配列の要素を1個(引数を指定した場合は自身の要素数を越えない範囲で n 個)
ランダムに選んで返します。
重複したインデックスは選択されません。そのため、自身がユニークな配列の
場合は返り値もユニークな配列になります。
配列が空の場合、無引数の場合は nil を、個数を指定した場合は空配列を返します。
srand()が有効です。
@param n 取得する要素の数を指定します。自身の要素数(self.length)以上の
値を指定した場合は要素数と同じ数の配列を返します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
... -
Array
# pack(template) -> String (9544.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。
テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデータ全て」の長さを
表します。型指定文字は以下で述べる pack テンプレート文字列の通りです。
buffer が指定されていれば、バッファとして使って返値として返します。
もし template の最初にオフセット (@) が指定されていれば、
結果はオフセットの後ろから詰められます。
buffer の元の内容がオフセットより長ければ、
オフセットより後ろの部分は上...