るりまサーチ

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

別のキーワード

  1. json quirks_mode
  2. json quirks_mode=
  3. state quirks_mode
  4. json quirks_mode?
  5. state quirks_mode=

クラス

モジュール

キーワード

検索結果

JSON::State#quirks_mode -> bool (18104.0)

Returns true, if quirks mode is enabled. Otherwise returns false.

Returns true, if quirks mode is enabled. Otherwise returns false.

JSON::State#quirks_mode=(enable) (6119.0)

If set to true, enables the quirks_mode mode.

...If set to true, enables the quirks_mode mode....

JSON::State#quirks_mode? -> bool (6104.0)

Returns true, if quirks mode is enabled. Otherwise returns false.

Returns true, if quirks mode is enabled. Otherwise returns false.

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

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

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

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


require 'json'

str=<<JSON
[1,2,3]
JSON
...
...

JSON
.load(str) # => [1,2,3]
JSON
.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]

str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON


JSON
.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON
.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}...
...# 以下が表示される
# "a"
# 1
# "b"
# 2
# "c"
# 3
# {"a"=>1, "b"=>2, "c"=>3}

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

@param proc Proc オブジェクトを指...

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

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

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

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


require 'json'

str=<<JSON
[1,2,3]
JSON
...
...

JSON
.load(str) # => [1,2,3]
JSON
.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]

str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON


JSON
.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON
.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}...
...# 以下が表示される
# "a"
# 1
# "b"
# 2
# "c"
# 3
# {"a"=>1, "b"=>2, "c"=>3}

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

@param proc Proc オブジェクトを指...

絞り込み条件を変える