Forum: Ruby Extract values from Hash map

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Naresh R. (Guest)
on 2009-02-16 08:09
Following is my code wherein I am reading from an XML file

require 'xmlconfigfile'

data ='script_data.xml')

data.no_hash_key_element_path = true
data.expand_attributes = true
senddata =

p senddata

*****************OUTPUT is as follows******************

{"MODIFY_2.uri"=>"tel:removed_email_address@domain.invalid", "MODIFY_1"=>nil,
"MODIFY_3.mname"=>"REGister", "MODIFY_3.header"=>"req_line",
"MODIFY_2"=>nil, "MODIFY_3"=>nil, "MODIFY_1.header"=>"from",
"REMOVE.header"=>"call_id", "MODIFY_2.mname"=>"InVIte",
"MODIFY_1.tag"=>"12345", "MODIFY_2.header"=>"req_line", "REMOVE"=>nil}

*********script_data.xml(XML File) is as follows***************

<TXN value = '1'>
  <SEND request = 'INVITE'>
    <MODIFY_1 header = 'from'  tag='12345'/>
    <MODIFY_2 header = 'req_line' mname = 'InVIte' uri =
'tel:removed_email_address@domain.invalid' />
    <MODIFY_3 header = 'req_line' mname = 'REGister'  />
    <REMOVE header = 'call_id' />

How can I get the hash values such that when I call "MODIFY_2.uri" it
must return "tel:removed_email_address@domain.invalid" and so on..,

This topic is locked and can not be replied to.