Method: CoreLibrary::XmlHelper.from_element
- Defined in:
- lib/apimatic-core/utilities/xml_helper.rb
.from_element(parent, name, clazz, datetime_format: nil) ⇒ Object
Converts element to a specific class.
188 189 190 191 192 193 194 |
# File 'lib/apimatic-core/utilities/xml_helper.rb', line 188 def from_element(parent, name, clazz, datetime_format: nil) element = parent.at_xpath(name) return nil if element.nil? return clazz.from_element element if clazz.respond_to? :from_element convert(element.text, clazz, datetime_format) end |