Sha256: 86bad7a69e8b8ef40facb270d2fc185a0b7d0aa322a68333ed2f56a3c6f490e4

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

require 'money_s3/builders/base_builder'
require 'money_s3/builders/mzdove_obdobi_type'

module MoneyS3
  module Builders
    class ZamestnanecType
      include BaseBuilder

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

        root << build_element('OsCislo', data[:os_cislo]) if data.key? :os_cislo
        root << build_element('Jmeno', data[:jmeno]) if data.key? :jmeno
        root << build_element('Stredisko', data[:stredisko]) if data.key? :stredisko
        root << build_element('DatNastup', data[:dat_nastup]) if data.key? :dat_nastup
        root << build_element('DatOdchod', data[:dat_odchod]) if data.key? :dat_odchod

        if data.key? :seznam_mzdovych_obdobi
          element = Ox::Element.new('SeznamMzdovychObdobi')
          data[:seznam_mzdovych_obdobi].each { |i| element << MzdoveObdobiType.new('MzdoveObdobi', i).builder }
          root << element
        end

        root
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
money_s3-0.10.0 lib/money_s3/builders/zamestnanec_type.rb
money_s3-0.9.0 lib/money_s3/builders/zamestnanec_type.rb
money_s3-0.8.0 lib/money_s3/builders/zamestnanec_type.rb
money_s3-0.7.0 lib/money_s3/builders/zamestnanec_type.rb
money_s3-0.6.0 lib/money_s3/builders/zamestnanec_type.rb