るりまサーチ

最速Rubyリファレンスマニュアル検索!
23件ヒット [1-23件を表示] (0.150秒)
トップページ > クエリ:JSON[x] > クエリ:freeze[x]

別のキーワード

  1. json to_json
  2. json parser
  3. json state
  4. json parse
  5. json generate

検索結果

NEWS for Ruby 2.7.0 (54.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ingPatternError
//}

//emlist{
json
= <<END
{
"name": "Alice",
"age": 30,
"children": [{ "name": "Bob", "age": 2 }]
}
END

JSON
.parse(json, symbolize_names: true) in {name: "Alice", children: [{name: name, age: age}]}

p name #=> "Bob"
p age #=> 2

JSON
.parse(json, symbolize_names: true) in {...
...ました。 15267

//emlist[][ruby]{
File.extname("foo.") #=> "."
//}

* FrozenError
* 新規メソッド
* 変更しようとしたfreezeされたオブジェクトを返すFrozenError#receiverメソッドが
追加されました。FrozenErrorをRubyのコードで発生す...
...うにModule#autoload?が
inheritオプショナル引数を受け付けるようになりました。 15777
* Module#nameが常にfreezeされた文字列を返すようになりました。
同じModuleは常に同じStringを返します。
この変更は実験的...

NEWS for Ruby 3.1.0 (48.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...hal
* 変更されたメソッド
* Marshal.load が freeze: true オプションを渡せるようになりました。返されるオブジェクトはクラスやモジュールのオブジェクトを除き、すべてfreezeされます。文字列は重複排除されます。 18148...
...1.0.1
* fiddle 1.1.0
* fileutils 1.6.0
* find 0.1.1
* io-console 0.5.10
* io-wait 0.2.1
* ipaddr 1.2.3
* irb 1.4.1
* json 2.6.1
* logger 1.5.0
* net-http 0.2.0
* net-protocol 0.1.2
* nkf 0.1.1
* open-uri 0.2.0
* openssl 3.0.0
* optparse 0.2...
...します。

//emlist[例][ruby]{
title = json[:article][:title]
//}

json
がnilの時、

//emlist{
$ ruby test.rb
test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)

title = json[:article][:title]
^^^^^^^^^^
//}

json
[:article] が返す時、

//emlist{
$ r...

NEWS for Ruby 3.0.0 (42.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...String literals are no longer frozen when
`# frozen-string-literal: true` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-la...
...Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` keyword will call `#initialize_clone` with the `freeze: true` keyword, and will return a frozen copy ev...
...pdate to Etc 1.2.0
* This version is Ractor compatible.
* Fiddle
* Update to Fiddle 1.0.5
* IRB
* Update to IRB 1.2.6
* JSON
* Update to JSON 2.5.0
* This version is Ractor compatible.
* Set
* Update to set 1.0.0
* SortedSet has been removed for dependency and per...

NEWS for Ruby 2.5.0 (12.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...。 13077
* -"literal" (String#-@) は同じオブジェクトを返すように最適化しました。
(Ruby 2.1以降の "literal".freeze と同じです) 13295
* String#casecmp, String#casecmp? に文字列でない引数を与えた場合、TypeErrorを発生させずにnilを返...
...option to a keyword argument
https://github.com/ruby/psych/pull/342
* Add :symbolize_names option to Psych.load, Psych.safe_load like JSON.parse
https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337
* Add Psych::Handler#event_location
htt...