Sha256: 53fe4e1cd795d871566c2b02b02433fc276f1b753e4dc754291224ff3df9e084

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

module MoneyS3
  module Builders
    class SouhrnDPHType
      include ParserCore::BaseBuilder

      def builder
        root = Ox::Element.new(name)
        if data.key? :attributes
          data[:attributes].each { |k, v| root[k] = v }
        end

        root << build_element('Zaklad0', data[:zaklad0], data[:zaklad0_attributes]) if data.key? :zaklad0
        root << build_element('Zaklad5', data[:zaklad5], data[:zaklad5_attributes]) if data.key? :zaklad5
        root << build_element('Zaklad22', data[:zaklad22], data[:zaklad22_attributes]) if data.key? :zaklad22
        root << build_element('DPH5', data[:dph5], data[:dph5_attributes]) if data.key? :dph5
        root << build_element('DPH22', data[:dph22], data[:dph22_attributes]) if data.key? :dph22
        if data.key? :seznam_dalsi_sazby
          element = Ox::Element.new('SeznamDalsiSazby')
          data[:seznam_dalsi_sazby].each { |i| element << DalsiSazba.new('DalsiSazba', i).builder }
          root << element
        end

        root
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-1.0.0 lib/money_s3/builders/souhrn_dph_type.rb