別のキーワード
ライブラリ
- ビルトイン (130)
- bigdecimal (12)
- drb (12)
-
irb
/ cmd / load (12) - optparse (12)
- rake (36)
-
rake
/ loaders / makefile (12) -
rake
/ testtask (12) - rubygems (12)
-
rubygems
/ version (12)
クラス
- BigDecimal (12)
- Class (12)
-
DRb
:: DRbUnknown (12) -
Gem
:: Version (12) -
IRB
:: ExtendCommand :: Load (12) - Module (24)
- Object (60)
- OptionParser (12)
-
Rake
:: Application (24) -
Rake
:: DefaultLoader (12) -
Rake
:: MakefileLoader (12) -
Rake
:: TestTask (12) - Random (24)
-
RubyVM
:: InstructionSequence (10)
モジュール
- Kernel (12)
キーワード
-
_ dump (24) -
_ load (12) -
add
_ loader (12) - autoload (12)
- autoload? (12)
- clone (12)
- dup (12)
- execute (12)
- gem (12)
- loader= (12)
-
marshal
_ dump (24) -
marshal
_ load (36) - reload (12)
-
to
_ binary (10)
検索結果
先頭5件
-
Random
# marshal _ load(array) -> Random (6114.0) -
Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。
...arshal_dumpを参考にしてください。
@raise ArgumentError array が3より大きい場合に発生します。
//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
r3 = r2.marshal_load(a1)
p r1 == r2 # => true
p r1 == r3 # => true
//}
@see Random#marshal_dump... -
Class
# _ load(str) -> Class (6108.0) -
Object#_dump を参照して下さい。
...Object#_dump を参照して下さい。
@param str Ruby のオブジェクトがダンプされた文字列を指定します。... -
Module
# autoload?(const _ name) -> String | nil (6107.0) -
autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。 また、ロード済みなら nil を返します。
...autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。
また、ロード済みなら nil を返します。
@param const_name String または Symbol で指定します。
@see Kernel.#autoload?
//emlist[例][ruby]{
autoload :Date, '......date'
autoload?(:Date) # => "date"
Date
autoload?(:Date) # => nil
autoload?(:Foo) # => nil
//}... -
Rake
:: TestTask # loader=(style) (6107.0) -
テストをロードする方法を指定します。
...法は以下の通りです。
: rake
Rake が提供する方法でテストをロードします。デフォルトはこれです。
: testrb
Ruby が提供する testrb コマンドを用いてテストをロードします。
: direct
コマンドラインで指定したファイルをロ... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (3047.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data......は他のマシンに移動できません。他のバージョンや他のアーキテクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary("extra_data")
# ※表示の都合上......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... -
IRB
:: ExtendCommand :: Load # execute(file _ name , priv = nil) -> nil (3023.0) -
ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実 行します。
...ファイル path を Ruby スクリプトとみなし、現在の irb インタプリタ上で実
行します。
Kernel.#load と異なり、path の内容を irb で一行ずつタイプしたかの
ように、irb 上で一行ずつ評価されます。
@param file_name ファイル名を文......字列で指定します。
@param priv 真を指定した場合は実行は内部的に生成される無名モジュール上
で行われ、グローバルな名前空間を汚染しません。
@raise LoadError 読み込みに失敗した場合に発生します。... -
Object
# marshal _ dump -> object (85.0) -
Marshal.#dump を制御するメソッドです。
.../marshal_load の仕組みは Ruby 1.8.0 から導入されました。
これから書くプログラムでは _dump/_load ではなく
marshal_dump/marshal_load を使うべきです。
@return 任意のオブジェクトで marshal_load の引数に利用できます。
//emlist[][ruby]{
class......shal_load(obj)
p obj
@foo = obj
end
end
foo = Foo.new(['foo', 'bar'])
p foo #=> #<Foo:0xbaf3b0 @foo=["foo", "bar"]>
dms = Marshal.dump(foo)
p dms #=> "\004\bU:\bFoo[\a\"\bfoo\"\bbar"
result = Marshal.load(dms) #=> ["foo", "bar"] # marshal_load の......_dump を定義するとインスタンス変数の情報は
ダンプされなくなるので、marshal_dump/marshal_load で扱う必要があります)。
marshal_dump/marshal_load はより高度な制御を行いたい場合や
拡張ライブラリで定義したクラスのインスタンス... -
Object
# _ dump(limit) -> String (73.0) -
Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。
...ている場合には、そのメソッドの結果が書き出されます。
バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオブジェクトが _dump と marshal_dump の両方の
メソッドを持つ場合は marsh......スタンスがメソッド _dump を持つクラスは必ず同じフォー
マットを読み戻すクラスメソッド _load を定義する必要があり
ます。_load はオブジェクトを表現した文字列を受け取り、それ
をオブジェクトに戻したものを返す必要......たものを返すように定義すべきです。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def _dump(limit)
Marshal.dump(@foo, limit)
end
def self._load(obj)
p obj
Foo.new(Marshal.load(obj))
end
end
foo = Foo.new(['foo', 'bar'])
p foo... -
BigDecimal
# _ dump -> String (41.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...BigDecimal._load で復元可能な文字列を返します。
Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => I......nfinity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#load...