Hi I am creating a hash as detailed below
hPhotoDetails = {
:photoId =>
pDoc.elements[''/rsp/photo''].attributes.get_attribute("id").value,
:title => pDoc.elements[''/rsp/photo/title''].text,
:description =>
pDoc.elements[''/rsp/photo/descripton''].text,
}
if the element /rsp/photo/descripton == <description/> or does not exist
an error is thrown.
Is there a way to get it to add nil if it does not exist without
breaking out of the hash creation?
Thanks
jon
--
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?hl=en
-~----------~----~----~----~------~----~------~--~---