るりまサーチ

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

別のキーワード

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

ライブラリ

モジュール

検索結果

JSON.#restore(source, proc = nil, options = {}) -> object (15136.0)

与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

...与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。


require 'json'

str=<<JSON...
...# "c"
# 3
# {"a"=>1, "b"=>2, "c"=>3}

@
param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。

@
param proc Proc オブジェクトを指定します。

@
param options オプションをハッシ...

Marshal.#restore(port, proc = nil) -> object (15126.0)

port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。

...び出します。

//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})

# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000, 1.0, :foo]
# ["a", 1, 10000000000, 1.0, :foo]
//}

@
param port String か IO (また...
...はそのサブクラス)の
インスタンスを指定します。

@
param proc 手続きオブジェクト。Proc

@
raise TypeError メジャーバージョンが異なるか、バージョンの大きな
マーシャルデータを読み込んだ場合に発生しま...

JSON.#load(source, proc = nil, options = {}) -> object (36.0)

与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

...与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。


require 'json'

str=<<JSON...
...# "c"
# 3
# {"a"=>1, "b"=>2, "c"=>3}

@
param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。

@
param proc Proc オブジェクトを指定します。

@
param options オプションをハッシ...

Marshal.#load(port, proc = nil) -> object (26.0)

port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。

...び出します。

//emlist[例][ruby]{
str = Marshal.dump(["a", 1, 10 ** 10, 1.0, :foo])
p Marshal.load(str, proc {|obj| p obj})

# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000, 1.0, :foo]
# ["a", 1, 10000000000, 1.0, :foo]
//}

@
param port String か IO (また...
...はそのサブクラス)の
インスタンスを指定します。

@
param proc 手続きオブジェクト。Proc

@
raise TypeError メジャーバージョンが異なるか、バージョンの大きな
マーシャルデータを読み込んだ場合に発生しま...