Class | Core::Providers::Multiverse::Parsers::NodesSectionParser |
In: |
core/serviceproviders/multiverse/parsers/nodes_section_parser.rb
|
Parent: | Object |
Check that the required nodes tags are present in the document.
# File core/serviceproviders/multiverse/parsers/nodes_section_parser.rb, line 68 def check(document) ; # no requirements for the <nodes> section end
Parse the nodes section of the document and return an array containing all the information
# File core/serviceproviders/multiverse/parsers/nodes_section_parser.rb, line 74 def parse(document, universe) universe.nodes = [] nodesroot = document.root.elements['nodes'] nodesroot.elements.each do |n| # TODO: validate node node = { :name => n.attributes['name'], :type => n.attributes['type'].to_i, :properties => {} } if n.elements['properties'] && !n.elements['properties'].size.zero? n.elements['properties'].elements.each do |prop| property = parse_property(prop.attributes) property.populator = find_populator_for(property, universe.meta[:name], universe.path) if not property.nil? node[:properties][property.key] = property end end end universe.nodes << node end end