Methods aren't objects, therefore you cannot store anything in them.
You can obtain a proxy object for a bound method using the Object#method
method and for an unbound method using the Module#instance_method
method, but that proxy object is, well, just a proxy object. In particular, it is not guaranteed that you will always get the same proxy object when you ask for one.
So, if you obtain a proxy object for a method, then store some documentation in it, then later obtain another proxy object for the same method, this might be a different proxy object which doesn't have your documentation in it.
Example:
class UnboundMethod
attr_accessor :doc
end
map = Array.instance_method(:map)
map.doc = '`map` maps a block over all elements'
map_again = Array.instance_method(:map)
map_again.doc
# => nil
map.doc
# => '`map` maps a block over all elements'
map.object_id == map_again.object_id
# => false
So, you cannot store your documentation in the method, because methods aren't objects and you cannot store it in the proxy object, because Ruby doesn't guarantee the identity of those proxy objects.
You need to store it somewhere else. Maybe in the Module
the method is defined in, indexed by the method name.