Class: MoneyS3::Builders::DalsiSazba

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

Instance Method Summary collapse

Instance Method Details

#builderObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/money_s3/builders/dalsi_sazba.rb', line 6

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

  root << build_element('Popis', data[:popis], data[:popis_attributes]) if data.key? :popis
  root << build_element('HladinaDPH', data[:hladina_dph], data[:hladina_dph_attributes]) if data.key? :hladina_dph
  root << build_element('Sazba', data[:sazba], data[:sazba_attributes]) if data.key? :sazba
  root << build_element('Zaklad', data[:zaklad], data[:zaklad_attributes]) if data.key? :zaklad
  root << build_element('DPH', data[:dph], data[:dph_attributes]) if data.key? :dph

  root
end