るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

RubyVM::InstructionSequence#to_binary(extra_data = nil) -> String (35265.0)

バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。

...て返します。
Ruby
VM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。

引数の extra_data はバイナリデータと共に保存されます。
Ruby
VM::InstructionSequence.load_from_binary_extra_data メソッ...
...ry で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキテクチャのRubyで作られたバイナリデータは使用できません。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary("extr...
...合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x00\x00\x00\x16\x02\x00\x00\n\x00\x00\x00\x01
# \x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x84\x01\x00\x00\x88\x01\x00
# \x00\x02\x02\x00\x00x86_64-darwin15\x00*\x00\x00\x00\x00\x00\x00\x00\x01
# \x00\x00\x00\x00\x0...

OptionParser#load(filename = nil) -> bool (21226.0)

指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。

...を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。

パースが成功した場合に true を返します。
ファイルが存在しなかった場合に false を返します。

@param filename 各行をパースしたいファイルの名前を文...
...

//emlist[例][ruby]{
r
equire "optparse"

IO.write("options.txt", %w(-a --b).join("\n"))
options = { a: false, b: false }
OptionParser.new do |opt|
opt.on('-a') { |v| options[:a] = v }
opt.on('--b') {|v| options[:b] = v }
opt.load("options.txt") # => true
opt.load("not_exist.txt") # =>...
...false
end

p options # => {:a=>true, :b=>true}
//}...

DRb::DRbUnknown#reload -> object (15333.0)

保持しているマーシャリングされたオブジェクトをRubyのオブジェクトに 変換しようと試みます。

...Rubyのオブジェクトに
変換しようと試みます。

DRbUnknown オブジェクトを受け取った後に対応するクラスが定義された場合、
このメソッドでそのクラスのオブジェクトに変換できます。
変換を試みて失敗した場合は DRbUnknow...

Gem::Version#marshal_load(array) -> nil (15320.0)

ダンプされた情報をロードし、自身を破壊的に変更します。

...ダンプされた情報をロードし、自身を破壊的に変更します。

//emlist[][ruby]{
version = Gem::Version.new('')
version.marshal_load(["1.2.0a"])
p version # => #<Gem::Version "1.2.0a">
//}

@param array バージョン情報を含む配列を指定します。...

Random#marshal_load(array) -> Random (12374.0)

Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。

...
R
andom#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。

@param array 三要素以下からなる配列を指定します。
何を指定するかはRandom#marshal_dumpを参考にしてください。

@raise ArgumentError array が3より大...
...きい場合に発生します。

//emlist[例][ruby]{
r
1 = Random.new(1)
a1 = r1.marshal_dump
r
2 = Random.new(3)
r
3 = r2.marshal_load(a1)

p r1 == r2 # => true
p r1 == r3 # => true
//}

@see Random#marshal_dump...

絞り込み条件を変える

Object#marshal_load(obj) -> object (12372.0)

Marshal.#load を制御するメソッドです。

...arshal.#load を制御するメソッドです。

some のダンプ結果(Marshal.dump(some)) をロードする(Marshal.load(Marshal.dump(some)))に
は some がメソッド marshal_load を持っていなければなりません。
このとき、marshal_dump の返り値が marshal_load...
...
marshal_load 時の self は、生成されたばかり(Class#allocate されたばかり) の状態です。

marshal_dump/marshal_load の仕組みは Ruby 1.8.0 から導入されました。
これから書くプログラムでは _dump/_load ではなく
marshal_dump/marshal_load を使...
...うべきです。

@param obj marshal_dump の返り値のコピーです。

@return 返り値は無視されます。


@see Object#marshal_dump, Marshal...

Module#autoload(const_name, feature) -> nil (6337.0)

定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。

...に参照した時に feature を Kernel.#require するように設定します。

const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload する対象を置き換えます。
const_name が(autoloadではなく)既に定義さ...
...せん。

@param const_name String または Symbol で指定します。
なお、const_name には、"::" 演算子を含めることはできません。
つまり、self の直下に定義された定数しか指定できません。

@param feature Kernel.#require と同様な方...
...ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
autoload :Bar, '/tmp/foo'
end
p Foo::Bar #=> Foo::Bar
//}

以下のようにモジュールを明示的にレシーバとして呼び出すこともできます。

//emlist[例][ruby...

Class#_load(str) -> Class (6314.0)

Object#_dump を参照して下さい。

...Object#_dump を参照して下さい。

@param str Ruby のオブジェクトがダンプされた文字列を指定します。...

Module#autoload?(const_name) -> String | nil (6313.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
//}...
<< 1 2 3 > >>