252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
# File 'lib/kaltura_client_base.rb', line 252
def self.object_from_xml(xml_element)
instance = nil
if xml_element.elements.size > 0
if xml_element.elements[1].name == 'item' instance = []
xml_element.elements.each('item') do | element |
instance.push(KalturaClassFactory.object_from_xml(element))
end
else object_type_element = xml_element.get_text('objectType')
if (object_type_element != nil)
object_class = xml_element.get_text('objectType').value
instance = Object.const_get(object_class).new
xml_element.elements.each do | element |
value = KalturaClassFactory.object_from_xml(element)
instance.send(self.underscore(element.name) + "=", value);
end
end
end
else return xml_element.text
end
return instance;
end
|