mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix Data docs (#6497)
This commit is contained in:
parent
bbbdb574c5
commit
13e87e5049
Notes:
git
2022-10-07 02:13:51 +09:00
Merged-By: k0kubun <takashikkbn@gmail.com>
1 changed files with 3 additions and 3 deletions
6
struct.c
6
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...
|
||||
|
|
Loading…
Add table
Reference in a new issue