Fix Undocumentable method defined on object instance YARD warnings

[#46491831]

Change code to use format that YARD can document without changing
semantics.