Sha256: 6a5f5d0b77c3f79c7cbc9b9513d5d91519324d5f26ec738054e16d928030b917

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'money_s3/builders/base_builder'
require 'money_s3/builders/dokl_ref_type'

module MoneyS3
  module Builders
    class KurzRozd
      include BaseBuilder

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

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

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

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

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

        if attributes.key? :doklad
          root << DoklRefType.new(attributes[:doklad], 'Doklad').builder
        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/kurz_rozd.rb