lib/money_s3/builders/doklad.rb in money_s3-1.0.0 vs lib/money_s3/builders/doklad.rb in money_s3-2.0.0
- old
+ new
@@ -3,12 +3,10 @@
class Doklad
include ParserCore::BaseBuilder
def builder
root = Ox::Element.new(name)
- if data.key? :attributes
- data[:attributes].each { |k, v| root[k] = v }
- end
+ root = add_attributes_and_namespaces(root)
root << build_element('Druh', data[:druh], data[:druh_attributes]) if data.key? :druh
root << build_element('Cislo', data[:cislo], data[:cislo_attributes]) if data.key? :cislo
root << build_element('GUID', data[:guid], data[:guid_attributes]) if data.key? :guid
root << build_element('PrijatDokl', data[:prijat_dokl], data[:prijat_dokl_attributes]) if data.key? :prijat_dokl
\ No newline at end of file