Skip to content

Commit 8415552

Browse files
authored
[DOC] Show NONE within Measure namespace (#12274)
Keep `NONE` within `Measure`
1 parent dd80d9b commit 8415552

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

struct.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1759,7 +1759,8 @@ rb_data_define(VALUE super, ...)
17591759
* important for redefining initialize in order to convert arguments or provide
17601760
* defaults:
17611761
*
1762-
* Measure = Data.define(:amount, :unit) do
1762+
* Measure = Data.define(:amount, :unit)
1763+
* class Measure
17631764
* NONE = Data.define
17641765
*
17651766
* def initialize(amount:, unit: NONE.new)
@@ -1768,7 +1769,7 @@ rb_data_define(VALUE super, ...)
17681769
* end
17691770
*
17701771
* Measure.new('10', 'km') # => #<data Measure amount=10.0, unit="km">
1771-
* Measure.new(10_000) # => #<data Measure amount=10000.0, unit=#<data NONE>>
1772+
* Measure.new(10_000) # => #<data Measure amount=10000.0, unit=#<data Measure::NONE>>
17721773
*
17731774
*/
17741775

0 commit comments

Comments
 (0)