3 ms·
> Ruby 3.1 adds a new core class called Data Typo? Ruby 3.1 was last year's version and the commit just got merged in September. It's mentioned in the NEWS fil
by Lammy 4y ago
> Ruby 3.1 adds a new core class called Data
Typo? Ruby 3.1 was last year's version and the commit just got merged in September. It's mentioned in the NEWS file for 3.2.0 Preview 3: https://github.com/ruby/ruby/blob/v3_2_0_preview3/NEWS.md https://github.com/ruby/ruby/blob/v3_2_0_preview3/NEWS.md
Looks cool though and I have several immutable key Structs in my current project that will be more appropriately implemented with Data. As the posts mentions, it will be nice to stop having to override `#to_a` to return nil to avoid Struct's collection-like behavior: https://github.com/okeeblow/DistorteD/blob/NEW%E2%80%85SENSATION/CHECKING%20YOU%20OUT/lib/checking-you-out/inner_spirit.rb#L80-L89 https://github.com/okeeblow/DistorteD/blob/NEW%E2%80%85SENSA...