Method: Sequel::Plugins::XmlSerializer::InstanceMethods#from_xml

Defined in:
lib/sequel/plugins/xml_serializer.rb

#from_xml(xml, opts = OPTS) ⇒ Object

Update the contents of this instance based on the given XML. Accepts the following options:

:name_proc

Proc or Hash that accepts a string and returns a string, used to convert tag names to column or association names.

:underscore

Sets the :name_proc option to one that calls underscore on the input string. Requires that you load the inflector extension or another library that adds String#underscore.



211
212
213
# File 'lib/sequel/plugins/xml_serializer.rb', line 211

def from_xml(xml, opts=OPTS)
  from_xml_node(Nokogiri::XML(xml).children.first, opts)
end