@@ -275,7 +275,12 @@ <h3 class="signature first" id="to_mod-class_method">
275275110
276276111
277277112
278- 113</ pre >
278+ 113
279+ 114
280+ 115
281+ 116
282+ 117
283+ 118</ pre >
279284 </ td >
280285 < td >
281286 < pre class ="code "> < span class ="info file "> # File 'lib/snaky_hash/snake.rb', line 56</ span >
@@ -284,7 +289,12 @@ <h3 class="signature first" id="to_mod-class_method">
284289 < span class ='const '> Module</ span > < span class ='period '> .</ span > < span class ='id identifier rubyid_new '> new</ span > < span class ='kw '> do</ span >
285290 < span class ='kw '> case</ span > < span class ='id identifier rubyid_key_type '> key_type</ span >
286291 < span class ='kw '> when</ span > < span class ='symbol '> :string</ span > < span class ='kw '> then</ span >
287- < span class ='comment '> # Converts a key to a string if possible, after underscoring
292+ < span class ='comment '> # Converts a key to a string if it is symbolizable, after underscoring
293+ </ span > < span class ='comment '> #
294+ </ span > < span class ='comment '> # @note checks for to_sym instead of to_s, because nearly everything responds_to?(:to_s)
295+ </ span > < span class ='comment '> # so respond_to?(:to_s) isn't very useful as a test, and would result in symbolizing integers
296+ </ span > < span class ='comment '> # amd it also provides parity between the :symbol behavior, and the :string behavior,
297+ </ span > < span class ='comment '> # regarding which keys get converted for a given version of Ruby.
288298</ span > < span class ='comment '> #
289299</ span > < span class ='comment '> # @param key [Object] the key to convert
290300</ span > < span class ='comment '> # @return [String, Object] the converted key or original if not convertible
@@ -348,7 +358,7 @@ <h3 class="signature first" id="to_mod-class_method">
348358</ div >
349359
350360 < div id ="footer ">
351- Generated on Thu May 22 04:27:14 2025 by
361+ Generated on Thu May 22 06:18:36 2025 by
352362 < a href ="https://yardoc.org " title ="Yay! A Ruby Documentation Tool " target ="_parent "> yard</ a >
353363 0.9.37 (ruby-3.4.3).
354364</ div >
0 commit comments