[DOC] Show NONE within Measure namespace (#12274)

Keep `NONE` within `Measure`
This commit is contained in:
Shannon Skipper 2025-01-08 20:53:49 -08:00 committed by GitHub
parent dd80d9b089
commit 841555245d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
Notes: git 2025-01-09 04:54:08 +00:00
Merged-By: nobu <nobu@ruby-lang.org>

View File

@ -1759,7 +1759,8 @@ rb_data_define(VALUE super, ...)
* important for redefining initialize in order to convert arguments or provide
* defaults:
*
* Measure = Data.define(:amount, :unit) do
* Measure = Data.define(:amount, :unit)
* class Measure
* NONE = Data.define
*
* def initialize(amount:, unit: NONE.new)
@ -1768,7 +1769,7 @@ rb_data_define(VALUE super, ...)
* end
*
* Measure.new('10', 'km') # => #<data Measure amount=10.0, unit="km">
* Measure.new(10_000) # => #<data Measure amount=10000.0, unit=#<data NONE>>
* Measure.new(10_000) # => #<data Measure amount=10000.0, unit=#<data Measure::NONE>>
*
*/