Sha256: e70a48b8eb2c8f4ddc704f9b85898b504aaaea74adcfd505a407b68cb3ee2eca

Contents?: true

Size: 2 KB

Versions: 5

Compression:

Stored size: 2 KB

Contents

require 'money_s3/builders/base_builder'
require 'money_s3/builders/skupina_kusovnik_type'

module MoneyS3
  module Builders
    class HeaderKusovnikType
      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('Cislo', data[:cislo]) if data.key? :cislo
        root << build_element('Druh', data[:druh]) if data.key? :druh
        root << build_element('Typ', data[:typ]) if data.key? :typ
        root << build_element('CisKarty', data[:cis_karty]) if data.key? :cis_karty
        root << build_element('Zkratka', data[:zkratka]) if data.key? :zkratka
        root << build_element('Popis', data[:popis]) if data.key? :popis
        root << build_element('NakladMat', data[:naklad_mat]) if data.key? :naklad_mat
        root << build_element('NakladMzd', data[:naklad_mzd]) if data.key? :naklad_mzd
        root << build_element('NakladKoop', data[:naklad_koop]) if data.key? :naklad_koop
        root << build_element('NakladStr', data[:naklad_str]) if data.key? :naklad_str
        root << build_element('Vyuziti', data[:vyuziti]) if data.key? :vyuziti
        root << build_element('Kalendar', data[:kalendar]) if data.key? :kalendar
        root << build_element('DesMist', data[:des_mist]) if data.key? :des_mist
        root << build_element('VarKus', data[:var_kus]) if data.key? :var_kus
        root << build_element('PriceMask', data[:price_mask]) if data.key? :price_mask
        root << build_element('TimeMask', data[:time_mask]) if data.key? :time_mask
        root << build_element('IDUziv', data[:id_uziv]) if data.key? :id_uziv
        root << build_element('DatumZmeny', data[:datum_zmeny]) if data.key? :datum_zmeny
        root << build_element('CasZmeny', data[:cas_zmeny]) if data.key? :cas_zmeny

        if data.key? :skupina
          root << SkupinaKusovnikType.new('Skupina', data[:skupina]).builder
        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/header_kusovnik_type.rb
money_s3-0.9.0 lib/money_s3/builders/header_kusovnik_type.rb
money_s3-0.8.0 lib/money_s3/builders/header_kusovnik_type.rb
money_s3-0.7.0 lib/money_s3/builders/header_kusovnik_type.rb
money_s3-0.6.0 lib/money_s3/builders/header_kusovnik_type.rb