Sha256: 875e90fc68c16266cbc49385f7c4f19e269dd4553e1c9650e7dba2f3f9fee9c4

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

require 'money_s3/builders/base_builder'
require 'money_s3/builders/eet_type'

module MoneyS3
  module Builders
    class DoklRefType
      include BaseBuilder

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

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

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

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

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

        if attributes.key? :eet
          root << EETType.new(attributes[:eet], 'EET').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/dokl_ref_type.rb