るりまサーチ

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

別のキーワード

  1. rss source
  2. _builtin source_location
  3. socket ip_block_source
  4. socket ip_unblock_source
  5. _builtin source_encoding

ライブラリ

モジュール

検索結果

JSON.#parse(source, options = {}) -> object (18227.0)

与えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。

...与えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。

@param source JSON 形式の文字列を指定します。

@param options オプションをハッシュで指定します。
指定可能なオプションは以下の通りです。

: :max_n...
...フォルトは偽です。

//emlist[例][ruby]{
require "json"

JSON.parse('[1,2,{"name":"tanaka","age":19}]')
# => [1, 2, {"name"=>"tanaka", "age"=>19}]

JSON.parse('[1,2,{"name":"tanaka","age":19}]', symbolize_names: true)
# => [1, 2, {:name=>"tanaka", :age=>19}]
//}

@see JSON::Parser#parse...

JSON.#parse!(source, options = {}) -> object (6239.0)

与えられた JSON 形式の文字列を Ruby オブジェクトに変換して返します。

...Ruby オブジェクトに変換して返します。

JSON.#parse よりも危険なデフォルト値が指定されているので
信頼できる文字列のみを入力として使用するようにしてください。

@param source JSON 形式の文字列を指定します。

@param options...
...:\"tanaka\",\"age\":19}, NaN]"
JSON.parse!(json_text)
# => [1, 2, {"name"=>"tanaka", "age"=>19}, NaN]

JSON.parse!(json_text, symbolize_names: true)
# => [1, 2, {:name=>"tanaka", :age=>19}, NaN]

JSON.parse(json_text) # => unexpected token at 'NaN]' (JSON::ParserError)
//}

@see JSON::Parser#parse...