lib/graphviz/xml.rb in ruby-graphviz-1.0.3 vs lib/graphviz/xml.rb in ruby-graphviz-1.0.4

- old
+ new

@@ -40,25 +40,25 @@ # # In: # * xml_file : XML File # * *options : Graph options: # * :text : show text nodes (default true) - # * :attrs : show XML attributs (default true) + # * :attrs : show XML attributes (default true) # def initialize( xml_file, *options ) @node_name = "00000" @show_text = true - @show_attributs = true + @show_attributes = true if options.nil? == false and options[0].nil? == false options[0].each do |xKey, xValue| case xKey.to_s when "text" @show_text = xValue options[0].delete( xKey ) when "attrs" - @show_attributs = xValue + @show_attributes = xValue options[0].delete( xKey ) end end end @@ -70,11 +70,11 @@ def parse_xml_node( xml_node ) #:nodoc: local_node_name = @node_name.clone @node_name.succ! label = xml_node.name - if xml_node.has_attributes? == true and @show_attributs == true + if xml_node.has_attributes? == true and @show_attributes == true label = "{ " + xml_node.name xml_node.attributes.each do |xName, xValue| label << "| { #{xName} | #{xValue} } " end @@ -102,10 +102,10 @@ @graph.add_nodes( text_node_name, "label" => xText, "color" => "black", "shape" => "ellipse" ) @graph.add_edges( local_node_name, text_node_name ) end end - ## Act: Search and add attributs + ## Act: Search and add attributes ## TODO xml_node.each_element( ) do |xml_child_node| child_node_name = parse_xml_node( xml_child_node ) @graph.add_edges( local_node_name, child_node_name )