lib/scaffold_parser/scaffolders/xsd/parser.rb in scaffold_parser-0.6.0 vs lib/scaffold_parser/scaffolders/xsd/parser.rb in scaffold_parser-0.7.0

- old
+ new

@@ -19,36 +19,25 @@ STACK = Stack.instance def call STACK.clear - classes = - xsds.map do |xsd| - if @options[:verbose] - puts "\n\nScaffolding schema which defines:\n#{xsd.children.map { |c| c.name }.compact}\n" - end - - xsd.reverse_traverse do |element, children_result| - handler = - if children_result.empty? - Handlers::Blank.new - elsif children_result.one? - children_result.first - else - Handlers::Elements.new(children_result) - end - - if @options[:verbose] - current_handler = handler.class.to_s.demodulize - childrens = (handler.instance_variable_get('@elements') || []).map { |child| child.class.to_s.demodulize } - puts "#{current_handler}#{childrens}##{element.element_name}" + xsds.each do |xsd| + xsd.reverse_traverse do |element, children_result| + handler = + if children_result.empty? + Handlers::Blank.new + elsif children_result.one? + children_result.first + else + Handlers::Elements.new(children_result) end - handler.send(element.element_name, element) - end + handler.send(element.element_name, element) end + end - classes = STACK.to_a + STACK.to_a end end end end end