lib/money_s3/builders/doklad.rb in money_s3-0.12.0 vs lib/money_s3/builders/doklad.rb in money_s3-1.0.0
- old
+ new
@@ -3,21 +3,21 @@
class Doklad
include ParserCore::BaseBuilder
def builder
root = Ox::Element.new(name)
- if data.respond_to? :attributes
- data.attributes.each { |k, v| root[k] = v }
+ if data.key? :attributes
+ data[:attributes].each { |k, v| root[k] = v }
end
- root << build_element('Druh', data[:druh]) if data.key? :druh
- root << build_element('Cislo', data[:cislo]) if data.key? :cislo
- root << build_element('GUID', data[:guid]) if data.key? :guid
- root << build_element('PrijatDokl', data[:prijat_dokl]) if data.key? :prijat_dokl
- root << build_element('VarSymbol', data[:var_symbol]) if data.key? :var_symbol
- root << build_element('Vystaveno', data[:vystaveno]) if data.key? :vystaveno
- root << build_element('DatUcPr', data[:dat_uc_pr]) if data.key? :dat_uc_pr
- root << build_element('PlnenoDPH', data[:plneno_dph]) if data.key? :plneno_dph
+ 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
+ root << build_element('VarSymbol', data[:var_symbol], data[:var_symbol_attributes]) if data.key? :var_symbol
+ root << build_element('Vystaveno', data[:vystaveno], data[:vystaveno_attributes]) if data.key? :vystaveno
+ root << build_element('DatUcPr', data[:dat_uc_pr], data[:dat_uc_pr_attributes]) if data.key? :dat_uc_pr
+ root << build_element('PlnenoDPH', data[:plneno_dph], data[:plneno_dph_attributes]) if data.key? :plneno_dph
root
end
end
end
\ No newline at end of file