require 'money_s3/builders/base_builder' require 'money_s3/builders/adresa_type' require 'money_s3/builders/telefon_type' module MoneyS3 module Builders class MojeFirmaType 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('Nazev', data[:nazev]) if data.key? :nazev root << build_element('ObchNazev', data[:obch_nazev]) if data.key? :obch_nazev root << build_element('FaktNazev', data[:fakt_nazev]) if data.key? :fakt_nazev root << build_element('EMail', data[:e_mail]) if data.key? :e_mail root << build_element('WWW', data[:www]) if data.key? :www root << build_element('ICO', data[:ico]) if data.key? :ico root << build_element('DIC', data[:dic]) if data.key? :dic root << build_element('DICSK', data[:dicsk]) if data.key? :dicsk root << build_element('Banka', data[:banka]) if data.key? :banka root << build_element('Ucet', data[:ucet]) if data.key? :ucet root << build_element('KodBanky', data[:kod_banky]) if data.key? :kod_banky root << build_element('KodPartn', data[:kod_partn]) if data.key? :kod_partn root << build_element('FyzOsoba', data[:fyz_osoba]) if data.key? :fyz_osoba root << build_element('MenaSymb', data[:mena_symb]) if data.key? :mena_symb root << build_element('MenaKod', data[:mena_kod]) if data.key? :mena_kod if data.key? :adresa root << AdresaType.new('Adresa', data[:adresa]).builder end if data.key? :obch_adresa root << AdresaType.new('ObchAdresa', data[:obch_adresa]).builder end if data.key? :fakt_adresa root << AdresaType.new('FaktAdresa', data[:fakt_adresa]).builder end if data.key? :tel root << TelefonType.new('Tel', data[:tel]).builder end if data.key? :fax root << TelefonType.new('Fax', data[:fax]).builder end if data.key? :mobil root << TelefonType.new('Mobil', data[:mobil]).builder end root end end end end