Method: UVPROJX#set_specific

Defined in:
lib/ebngen/adapter/mdk/uvprojx.rb

#set_specific(target_node, doc) ⇒ Object

set_specific Params:

  • doc: hash to add to target

  • target_node: node to be added to

  • note:

    can not add none exist node for mdk xml
    


175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/ebngen/adapter/mdk/uvprojx.rb', line 175

def set_specific(target_node, doc)
  doc.each do |key, value|
    options = target_node.xpath(key)
    options.each do |option|
      if value.class == Hash
        value.each do |subnode|
            add_specific(option, subnode)
        end
      elsif value.class == String
          option.content = value
          break
      elsif value.class == Array
          option.content = ""
          value.each do |line|
            option.content += ";#{line}"
          end
          break
      else
        puts "not support by set_specific #{value}"
      end
    end
  end
end