Soap4r en keyvaluepair

I’m making a soap connection to an external program that will give me
informatieoon in keyvalue pairs like this manner

email [email protected] optin1 true

I want to map it on my object that has the same keys I’m doing it like
this
@contactInfo.keyValuePairs.each do |kvp|
@knowington.update_attribute(kvp.key,kvp.value)
end

The big drawback is that it will update the object for every key is
there a better way to deal with this ???

On 10 Jul 2008, at 10:11, Daniel Van den oord wrote:

true

I want to map it on my object that has the same keys I’m doing it like
this
@contactInfo.keyValuePairs.each do |kvp|
@knowington.update_attribute(kvp.key,kvp.value)
end

The big drawback is that it will update the object for every key is
there a better way to deal with this ???
Off the top of my head,
build up a hash and use update_attributes or do @knowington[kvp.key] =
kvp.key and then save at the end or call the accessor methods and then
save

Fred