ruby-changes:73880
From: Yuri <ko1@a...>
Date: Fri, 7 Oct 2022 02:13:50 +0900 (JST)
Subject: [ruby-changes:73880] 13e87e5049 (master): fix Data docs (#6497)
https://git.ruby-lang.org/ruby.git/commit/?id=13e87e5049 From 13e87e5049dd418e764f30a9cc45f787d239d466 Mon Sep 17 00:00:00 2001 From: Yuri Smirnov <tycooon@y...> Date: Thu, 6 Oct 2022 23:13:17 +0600 Subject: fix Data docs (#6497) --- struct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/struct.c b/struct.c index ae24b5450d..da84fa6bcb 100644 --- a/struct.c +++ b/struct.c @@ -1855,13 +1855,13 @@ rb_data_inspect(VALUE s) https://github.com/ruby/ruby/blob/trunk/struct.c#L1855 * * Examples: * - * Measure = Data.new(:amount, :unit) + * Measure = Data.define(:amount, :unit) * * Measure[1, 'km'] == Measure[1, 'km'] #=> true * Measure[1, 'km'] == Measure[2, 'km'] #=> false * Measure[1, 'km'] == Measure[1, 'm'] #=> false * - * Measurement = Data.new(:amount, :unit) + * Measurement = Data.define(:amount, :unit) * # Even though Measurement and Measure have the same "shape" * # their instances are never equal * Measure[1, 'km'] == Measurement[1, 'km'] #=> false @@ -1878,7 +1878,7 @@ rb_data_inspect(VALUE s) https://github.com/ruby/ruby/blob/trunk/struct.c#L1878 * The subtle difference with #== is that members are also compared with their * #eql? method, which might be important in some cases: * - * Measure = Data.new(:amount, :unit) + * Measure = Data.define(:amount, :unit) * * Measure[1, 'km'] == Measure[1.0, 'km'] #=> true, they are equal as values * # ...but... -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/