Class: MoneyS3::Builders::InvDoklType

Inherits:
Object
  • Object
show all
Includes:
ParserCore::BaseBuilder
Defined in:
lib/money_s3/builders/inv_dokl_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
# File 'lib/money_s3/builders/inv_dokl_type.rb', line 6

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

  root << build_element('CisloD', data[:cislo_d], data[:cislo_d_attributes]) if data.key? :cislo_d
  root << build_element('InvID', data[:inv_id], data[:inv_id_attributes]) if data.key? :inv_id
  root << build_element('Popis', data[:popis], data[:popis_attributes]) if data.key? :popis
  root << build_element('Prac', data[:prac], data[:prac_attributes]) if data.key? :prac
  root << build_element('Kontr', data[:kontr], data[:kontr_attributes]) if data.key? :kontr
  root << build_element('Poznamka', data[:poznamka], data[:poznamka_attributes]) if data.key? :poznamka
  if data.key? :polozka
    data[:polozka].each { |i| root << PolInvDoklType.new('Polozka', i).builder }
  end

  root
end