D
deane.barker
I have a YAML file which I get into Ruby using the "load" method of the
YAML class.
I would like Ruby to respect the order of elements in the YAML file, so
I could get them out of the object in the same order they appear in the
file.
Is this possible? Ruby puts the elements into a Hash, which famously
doesn't promise any ordering when the elements come out, so I'm not
optimistic.
So, is it possible to get elements out of a YAML object in Ruby in the
same order that they appear in the file, or should I move on to another
way of doing it?
Deane
YAML class.
I would like Ruby to respect the order of elements in the YAML file, so
I could get them out of the object in the same order they appear in the
file.
Is this possible? Ruby puts the elements into a Hash, which famously
doesn't promise any ordering when the elements come out, so I'm not
optimistic.
So, is it possible to get elements out of a YAML object in Ruby in the
same order that they appear in the file, or should I move on to another
way of doing it?
Deane