Class: MoneyS3::Builders::ZamestnanecType

Inherits:
Object
  • Object
show all
Includes:
ParserCore::BaseBuilder
Defined in:
lib/money_s3/builders/zamestnanec_type.rb

Instance Method Summary collapse

Instance Method Details

#builderObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/money_s3/builders/zamestnanec_type.rb', line 6

def builder
  root = Ox::Element.new(name)
  root = add_attributes_and_namespaces(root)

  root << build_element('OsCislo', data[:os_cislo], data[:os_cislo_attributes]) if data.key? :os_cislo
  root << build_element('Jmeno', data[:jmeno], data[:jmeno_attributes]) if data.key? :jmeno
  root << build_element('Stredisko', data[:stredisko], data[:stredisko_attributes]) if data.key? :stredisko
  root << build_element('DatNastup', data[:dat_nastup], data[:dat_nastup_attributes]) if data.key? :dat_nastup
  root << build_element('DatOdchod', data[:dat_odchod], data[:dat_odchod_attributes]) 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