Sha256: 22e2ae3c00b4d8f6fd643268fbf74f237e143b10ad9174c0832870a46dda87ce

Contents?: true

Size: 1.12 KB

Versions: 1

Compression:

Stored size: 1.12 KB

Contents

require 'money_s3/builders/base_builder'

module MoneyS3
  module Builders
    class DalsiSazba
      include BaseBuilder

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

        if attributes.key? :popis
          element = Ox::Element.new('Popis')
          element << attributes[:popis] if attributes[:popis]
          root << element
        end

        if attributes.key? :hladina_dph
          element = Ox::Element.new('HladinaDPH')
          element << attributes[:hladina_dph] if attributes[:hladina_dph]
          root << element
        end

        if attributes.key? :sazba
          element = Ox::Element.new('Sazba')
          element << attributes[:sazba] if attributes[:sazba]
          root << element
        end

        if attributes.key? :zaklad
          element = Ox::Element.new('Zaklad')
          element << attributes[:zaklad] if attributes[:zaklad]
          root << element
        end

        if attributes.key? :dph
          element = Ox::Element.new('DPH')
          element << attributes[:dph] if attributes[:dph]
          root << element
        end

        root
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
money_s3-0.5.0 lib/money_s3/builders/dalsi_sazba.rb