Add Struct examples to NEWS [ci skip]

This commit is contained in:
Takashi Kokubun 2022-12-15 11:53:32 -08:00
Родитель 2ae0e27a69
Коммит 53db8fb450
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6FFC433B12EE23DD
1 изменённых файлов: 10 добавлений и 0 удалений

10
NEWS.md
Просмотреть файл

@ -345,6 +345,16 @@ Note: We're only listing outstanding class updates.
* A Struct class can also be initialized with keyword arguments
without `keyword_init: true` on Struct.new [[Feature #16806]]
```ruby
Post = Struct.new(:id, :name)
# In addition to this,
Post.new(1, "hello") #=> #<struct Post id=1, name="hello">
# Let the following initialization also work
Post.new(id: 1, name: "hello") #=> #<struct Post id=1, name="hello">
```
* Thread
* Thread#each_caller_location is added. [[Feature #16663]]