A small problem here. As per documentation on http://corelib.rubyonrails.org/classes/YAML.html YAML.load(string) should just return a hash. However on my windows machine it returns something like this: #<YAML::Syck::DomainType:0x36d5038 @domain="yaml.org,2002", @type_id="map:HashWithIndifferentAccess", @value {"key"=>"value", "key"=>"value", "key"=>"value", "key"=>"value", }> Obviously, on windows machine I have to do something like YAML.load(something).value[''key''] to get something. On Linux box .value method will fail as we only get a simple hash there. Any idea what is goin on? A bug? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2006-Aug-23 18:20 UTC
[Rails] Re: YAML.load(some_string) doesn''t return hash?
Can we see the YAML you''re trying to load? Jason On 8/23/06, Oleg Kh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > A small problem here. As per documentation on > http://corelib.rubyonrails.org/classes/YAML.html YAML.load(string) > should just return a hash. However on my windows machine it returns > something like this: > > #<YAML::Syck::DomainType:0x36d5038 > @domain="yaml.org,2002", > @type_id="map:HashWithIndifferentAccess", > @value> {"key"=>"value", > "key"=>"value", > "key"=>"value", > "key"=>"value", > }> > > Obviously, on windows machine I have to do something like > YAML.load(something).value[''key''] to get something. On Linux box .value > method will fail as we only get a simple hash there. > > Any idea what is goin on? A bug? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---