Method: CoreLibrary::XmlHelper.add_as_attribute
- Defined in:
- lib/apimatic-core/utilities/xml_helper.rb
.add_as_attribute(root, name, value, datetime_format: nil) ⇒ Object
Adds the value as an attribute.
49 50 51 52 53 54 55 |
# File 'lib/apimatic-core/utilities/xml_helper.rb', line 49 def add_as_attribute(root, name, value, datetime_format: nil) return if value.nil? value = datetime_to_s(value, datetime_format) if value.instance_of?(DateTime) root[name] = value end |