lib/quickbooks/support/qbxml.rb in quickbooks_api-0.0.3 vs lib/quickbooks/support/qbxml.rb in quickbooks_api-0.0.4

- old
+ new

@@ -26,6 +26,18 @@ qbxml.map! { |l| l.strip } qbxml.reject! { |l| l =~ COMMENT_MATCHER } qbxml.join('') end + def set_required_attributes(xml_obj) + required_attributes = get_required_xml_attributes + xml_obj.attributes.each do |a,v| + if required_attributes.keys.include?(a) + xml_obj.set_attribute(a, required_attributes[a]) + else + xml_obj.remove_attribute(a) + end + end + xml_obj + end + end