P
Paul Hepworth
Hello,
I am new to Ruby and have an issue with a xmlsimple object resulting
from a 3rd party webservice.
The xml has nodes that have hyphens (-) in the names. When I try to
access various hashes using the object variables I get errors telling
that the variable doesn't exists. I realize that the ruby syntax doesnot
like hyphens in variable names, how do I get around this?
Example XML:
<object>
<tree-lists>
<tree-list>
...
</tree-list>
...
</tree-lists>
</object>
Example Ruby :
for tlist in object.tree-lists
...
end
Error would be:
NoMethodError in TreeController#importproject
undefined method `tree' for #<TreeLib::Record:0x39171e8>
Thanks in advance.
Paul
I am new to Ruby and have an issue with a xmlsimple object resulting
from a 3rd party webservice.
The xml has nodes that have hyphens (-) in the names. When I try to
access various hashes using the object variables I get errors telling
that the variable doesn't exists. I realize that the ruby syntax doesnot
like hyphens in variable names, how do I get around this?
Example XML:
<object>
<tree-lists>
<tree-list>
...
</tree-list>
...
</tree-lists>
</object>
Example Ruby :
for tlist in object.tree-lists
...
end
Error would be:
NoMethodError in TreeController#importproject
undefined method `tree' for #<TreeLib::Record:0x39171e8>
Thanks in advance.
Paul