種類
- 特異メソッド (40)
- モジュール関数 (33)
- 定数 (33)
- インスタンスメソッド (9)
ライブラリ
- ビルトイン (115)
クラス
- Encoding (44)
-
RubyVM
:: InstructionSequence (27)
モジュール
-
File
:: Constants (11) - Kernel (22)
- Math (11)
キーワード
-
ASCII
_ 8BIT (11) - aliases (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - log2 (11)
-
name
_ list (11) - open (22)
-
to
_ binary (9)
検索結果
先頭5件
-
File
:: Constants :: BINARY -> Integer (26117.0) -
ファイルをバイナリとして開きます。 open(2) で O_BINARYが指定できる場合に使えます。 File.openで使用します。
...ファイルをバイナリとして開きます。
open(2) で O_BINARYが指定できる場合に使えます。
File.openで使用します。... -
Encoding
:: BINARY -> Encoding (23101.0) -
ASCII-8BIT、ASCII互換オクテット列用のエンコーディングです。
ASCII-8BIT、ASCII互換オクテット列用のエンコーディングです。
もっぱら文字エンコーディングを持たないデータ、文字を符号化したのではない単なるバイトの列を表現するために用いますが、このエンコーディングは ASCII 互換であることがポイントです。 -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (14248.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (14232.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (14147.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソッドでこの文字......_binary で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキテクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary(......0\x00numE\x7F\x00\x00\x02\x00\x00\x00\x00
# \x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00+\xA0\x01\x00\x00\xAC\x01\x00
# \x00\xCA\x01\x00\x00\xD6\x01\x00\x00\xED\x01\x00\x00extra_data"
//}
@see RubyVM::InstructionSequence.load_from_binary
@see RubyVM::InstructionSequence.load_from_binary_extra_data... -
Math
. # log2(x) -> Float (8016.0) -
2 を底とする x の対数(binary logarithm)を返します。
...2 を底とする x の対数(binary logarithm)を返します。
@param x 正の実数
@raise TypeError xに数値以外を指定した場合に発生します。
@raise Math::DomainError x に範囲外の実数を指定した場合に発生します。
@raise RangeError xに実数以外... -
Encoding
. aliases -> Hash (8006.0) -
エンコーディングの別名に対して元の名前を対応づけるハッシュを返します。
...ンコーディングの別名に対して元の名前を対応づけるハッシュを返します。
//emlist[例][ruby]{
p Encoding.aliases
#=> {"BINARY"=>"ASCII-8BIT", "ASCII"=>"US-ASCII", "ANSI_X3.4-1968"=>"US-ASCII",
# "SJIS"=>"Windows-31J", "eucJP"=>"EUC-JP", "CP932"=>"Windows-31J"}
//}... -
Encoding
. name _ list -> [String] (8006.0) -
利用可能なエンコーディングの名前を文字列の配列で返します。
...利用可能なエンコーディングの名前を文字列の配列で返します。
//emlist[例][ruby]{
p Encoding.name_list
#=> ["US-ASCII", "ASCII-8BIT", "UTF-8",
# "ISO-8859-1", "Shift_JIS", "EUC-JP",
# "Windows-31J",
# "BINARY", "CP932", "eucJP", ...]
//}... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) -> IO (8006.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
...受けません。
これらのいずれに対しても "b" フラグを ("r+b"のように) つけることがで
きます (整数なら File::BINARY )。この場合、バイナリモードでオープン
します (ただし、DOS/Windowsのようにシステムがテキスト/バイナリで... -
Kernel
. # open(file , mode _ enc = "r" , perm = 0666) {|io| . . . } -> object (8006.0) -
file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。
...受けません。
これらのいずれに対しても "b" フラグを ("r+b"のように) つけることがで
きます (整数なら File::BINARY )。この場合、バイナリモードでオープン
します (ただし、DOS/Windowsのようにシステムがテキスト/バイナリで...