Method: Xampl::XamplObject#new_from_xml_string

Defined in:
lib/xamplr/xampl-object.rb

#new_from_xml_string(xml_string, id = nil, tokenise = true) ⇒ Object



244
245
246
247
248
249
250
# File 'lib/xamplr/xampl-object.rb', line 244

def new_from_xml_string(xml_string, id=nil, tokenise=true)
  thing = FromXML.new.parse_string(xml_string, tokenise)
  if thing.indexed_by then
    thing.set_the_index(id) if id
    self << thing if thing.get_the_index
  end
end