<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_data.rb, branch v4.0.3</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) d7a6ff8224519005d2deeb3f4e98689a8a0835ad: [Backport #21819]</title>
<updated>2026-01-13T01:13:00+00:00</updated>
<author>
<name>Takashi Kokubun</name>
<email>takashikkbn@gmail.com</email>
</author>
<published>2026-01-13T01:13:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6273c59a6e1f8587e549d5a5f44fd9363e6eb018'/>
<id>6273c59a6e1f8587e549d5a5f44fd9363e6eb018</id>
<content type='text'>
	[PATCH] [Bug #21819] Data objects without members should also be frozen
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[PATCH] [Bug #21819] Data objects without members should also be frozen
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #21440] Stop caching member list in frozen Data/Struct class</title>
<updated>2025-06-13T05:22:06+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-06-13T05:15:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2e7e78cd590d20aa9d41422e96302f3edd73f623'/>
<id>2e7e78cd590d20aa9d41422e96302f3edd73f623</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add some test cases to Data test</title>
<updated>2023-11-30T12:35:04+00:00</updated>
<author>
<name>OKURA Masafumi</name>
<email>masafumi.o1988@gmail.com</email>
</author>
<published>2023-11-26T09:06:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=18f218d6a14f1a4744327d814554bfda04f1f119'/>
<id>18f218d6a14f1a4744327d814554bfda04f1f119</id>
<content type='text'>
I noticed that `deconstruct` and `hash` don't have enough coverage.
The behavior of `hash` is documented so I copied it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I noticed that `deconstruct` and `hash` don't have enough coverage.
The behavior of `hash` is documented so I copied it.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add missing test for Data.initialize</title>
<updated>2023-04-06T06:24:38+00:00</updated>
<author>
<name>Marc-Andre Lafortune</name>
<email>github@marc-andre.ca</email>
</author>
<published>2023-04-05T21:12:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=061f5f4374a20f1ea1234a1bc204862c5fda1fed'/>
<id>061f5f4374a20f1ea1234a1bc204862c5fda1fed</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19259] `Data#with` should call `initialize` method</title>
<updated>2023-02-14T03:02:07+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-26T14:04:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=45f0e3a673964069a4c9c57ce8665cbc21ac267f'/>
<id>45f0e3a673964069a4c9c57ce8665cbc21ac267f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add copy with changes functionality for Data objects (#6766)</title>
<updated>2022-12-22T00:27:38+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk@paralaus.com</email>
</author>
<published>2022-12-22T00:27:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=99cee85775bc5656b942bf4e1b0568a8f40addcd'/>
<id>99cee85775bc5656b942bf4e1b0568a8f40addcd</id>
<content type='text'>
Implements [Feature #19000]

This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.

Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.

If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.

However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
    Point = Data.define(:x, :y)
    point = Point.new(x: 1, y: 2)
    point.with(x: 3) # =&gt; #&lt;data Point x: 3, y: 2&gt;
```

Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #19000]

This commit adds copy with changes functionality for `Data` objects
using a new method `Data#with`.

Since Data objects are immutable, the only way to change them is by
creating a copy. This PR adds a `with` method for `Data` class instances
that optionally takes keyword arguments.

If the `with` method is called with no arguments, the behaviour is the
same as the `Kernel#dup` method, i.e. a new shallow copy is created
with no field values changed.

However, if keyword arguments are supplied to the `with` method, then
the copy is created with the specified field values changed. For
example:
```ruby
    Point = Data.define(:x, :y)
    point = Point.new(x: 1, y: 2)
    point.with(x: 3) # =&gt; #&lt;data Point x: 3, y: 2&gt;
```

Passing positional arguments to `with` or passing keyword arguments to
it that do not correspond to any of the members of the Data class will
raise an `ArgumentError`.

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19163] Marshal-loaded Data object also should be frozen</title>
<updated>2022-12-01T15:56:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-01T13:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5872fd6f6cc5ddde33df94fb11e773eeb653e55e'/>
<id>5872fd6f6cc5ddde33df94fb11e773eeb653e55e</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Feature #19163] Data object should be frozen</title>
<updated>2022-12-01T15:56:52+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-12-01T08:26:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a14a1a5626a4d8e661a3e606f8f92b8c455b9a04'/>
<id>a14a1a5626a4d8e661a3e606f8f92b8c455b9a04</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Cannot `define` from defined `Data` class again</title>
<updated>2022-10-03T14:28:01+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2022-10-03T14:28:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cbd82f52502630e5298c8b82e8d52c59ee5454e1'/>
<id>cbd82f52502630e5298c8b82e8d52c59ee5454e1</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Add Data class implementation: Simple immutable value object</title>
<updated>2022-09-30T09:23:19+00:00</updated>
<author>
<name>Victor Shepelev</name>
<email>zverok.offline@gmail.com</email>
</author>
<published>2022-09-30T09:23:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ad651925e365ca18645f05b5e9b2eca9cd5721bc'/>
<id>ad651925e365ca18645f05b5e9b2eca9cd5721bc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
