Sha256: a23a4749e3225c55d363602053b3a63c1ce5b3414aeb3cc8d4e739017a80f3b3

Contents?: true

Size: 899 Bytes

Versions: 1

Compression:

Stored size: 899 Bytes

Contents

require 'money_s3/builders/base_builder'
require 'money_s3/builders/dalsi_sazba'

module MoneyS3
  module Builders
    class SouhrnDPHType
      include BaseBuilder

      attr_accessor :zaklad0, :zaklad5, :zaklad22, :dph5, :dph22, :seznam_dalsi_sazby

      def builder
        root = Ox::Element.new(element_name)

        root << (Ox::Element.new('Zaklad0') << zaklad0) if zaklad0
        root << (Ox::Element.new('Zaklad5') << zaklad5) if zaklad5
        root << (Ox::Element.new('Zaklad22') << zaklad22) if zaklad22
        root << (Ox::Element.new('DPH5') << dph5) if dph5
        root << (Ox::Element.new('DPH22') << dph22) if dph22

        if seznam_dalsi_sazby
          element = Ox::Element.new('SeznamDalsiSazby')
          seznam_dalsi_sazby.each { |i| element << DalsiSazba.new(i, 'DalsiSazba').builder }
          root << element
        end

        root
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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