summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authorYuri Smirnov <tycooon@yandex.ru>2022-10-06 23:13:17 +0600
committerGitHub <noreply@github.com>2022-10-06 10:13:17 -0700
commit13e87e5049dd418e764f30a9cc45f787d239d466 (patch)
tree7c304ec35e2a352b05571b8d0ad5749420fef4ab /struct.c
parentbbbdb574c56b5ba8b91f671404645569dc6f156b (diff)
downloadruby-13e87e5049dd418e764f30a9cc45f787d239d466.tar.gz
fix Data docs (#6497)
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c6
1 files 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)
*
* 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)
* 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...