Re: argh! more undocumented mysteries: to_yaml
- From: Mateusz Tybura <wujciol@xxxxxxxxx>
- Date: Sun, 16 Mar 2008 09:10:03 -0500
[Note: parts of this message were removed to make it a legal post.]
I'm beginner to but I understand it. You cannot use to_yaml for Array,
because there's no method to_yaml for Array. Try to read about
Object#to_yaml in Ruby Documentation.
2008/3/16, Tom Cloyd <tomcloyd@xxxxxxxxxxx>:
Beginner woes, here, no doubt, but woes nevertheless.
I'm exploring the wonders of the Object class, and I see Object#to_yaml.
Seems pretty obvious what to expect here, which would seem to account
for the total lack of documentation in each of the gazillion instances
of this method which appear in core library. Still, let's test it...
irb(main):010:0> [2,5,3,6,'abc'].to_yaml
NoMethodError: undefined method `to_yaml' for [2, 5, 3, 6, "abc"]:Array
from (irb):10
from :0
Can someone explain what just happened?
Thanks!
t.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@xxxxxxxxxxxx >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.
- Follow-Ups:
- Re: argh! more undocumented mysteries: to_yaml
- From: Tom Cloyd
- Re: argh! more undocumented mysteries: to_yaml
- References:
- argh! more undocumented mysteries: to_yaml
- From: Tom Cloyd
- argh! more undocumented mysteries: to_yaml
- Prev by Date: Re: Newbie with Ruby and RoR
- Next by Date: Re: argh! more undocumented mysteries: to_yaml
- Previous by thread: argh! more undocumented mysteries: to_yaml
- Next by thread: Re: argh! more undocumented mysteries: to_yaml
- Index(es):
Relevant Pages
|