Module: OM::XML::NodeGenerator
- Defined in:
- lib/om/xml/node_generator.rb
Class Method Summary collapse
-
.generate(term, builder_new_value, opts = {}) ⇒ Nokogiri::XML::Document
Module Methods – These methods can be called directly on the Module itself Ex.
Class Method Details
.generate(term, builder_new_value, opts = {}) ⇒ Nokogiri::XML::Document
Module Methods – These methods can be called directly on the Module itself Ex. term = t.retrieve_term(:person, :first_name) OM::XML::NodeGenerator.generate(term, “John”)
11 12 13 14 15 16 17 18 19 |
# File 'lib/om/xml/node_generator.rb', line 11 def self.generate(term, builder_new_value, opts={}) template = term.xml_builder_template(opts) builder_call_body = eval('"' + template + '"') builder = Nokogiri::XML::Builder.new do |xml| eval( builder_call_body ) end return builder.doc end |