I noticed soon something weird about Object documentation (in fact, one
of my colleagues saw it and he asked me what’s the catch):
- Object class (http://www.ruby-doc.org/core/classes/Object.html) have
one method called to_yaml. Now, the funny thing is that when trying to
irb(main):001:0> a = “abc”
NoMethodError: undefined method `to_yaml’ for “abc”:String
but after require ‘yaml’ everything is ok.
Ok, I know that yaml is placing this method to Object class when
required, but why is it by default documented in Object class ? What may
be the reason ?