irb(main):001:0> a = "abc"
=> "abc"
irb(main):002:0> a.to_yaml
NoMethodError: undefined method `to_yaml' for "abc":String
from (irb):2
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 ?
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 ?
It's the way rdoc currently works; it parses a set of files and rolls up methods found for the various classes and modules it encounters. It is not able to indicate from where a method originated or that certain methods are provided on an object only when one or another module is included.
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 ?
It's the way rdoc currently works; it parses a set of files and rolls up
methods found for the various classes and modules it encounters. It is
not able to indicate from where a method originated or that certain
methods are provided on an object only when one or another module is
included.