Skip to content

Commit

Permalink
[DOC] Show NONE within Measure namespace (ruby#12274)
Browse files Browse the repository at this point in the history
Keep `NONE` within `Measure`
  • Loading branch information
havenwood authored Jan 9, 2025
1 parent dd80d9b commit 8415552
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions struct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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>>
*
*/

Expand Down

0 comments on commit 8415552

Please sign in to comment.