lib/money_s3/builders/valuty.rb in money_s3-0.5.0 vs lib/money_s3/builders/valuty.rb in money_s3-0.6.0

- old
+ new

@@ -6,23 +6,22 @@ module Builders class Valuty include BaseBuilder def builder - root = Ox::Element.new(element_name) - - if attributes.key? :celkem - element = Ox::Element.new('Celkem') - element << attributes[:celkem] if attributes[:celkem] - root << element + root = Ox::Element.new(name) + if data.respond_to? :attributes + data.attributes.each { |k, v| root[k] = v } end - if attributes.key? :mena - root << MenaType.new(attributes[:mena], 'Mena').builder + root << build_element('Celkem', data[:celkem]) if data.key? :celkem + + if data.key? :mena + root << MenaType.new('Mena', data[:mena]).builder end - if attributes.key? :souhrn_dph - root << SouhrnDPHType.new(attributes[:souhrn_dph], 'SouhrnDPH').builder + if data.key? :souhrn_dph + root << SouhrnDPHType.new('SouhrnDPH', data[:souhrn_dph]).builder end root end end \ No newline at end of file