lib/opml_janitor.rb
def filter!(data)
      data.each do |node|
        if node.name == 'outline'
          outline = Outline.new(node).to_hash
          if node.children.length > 0
            title = outline[:title] || outline[:text]
            filter!(node.children)
          else
            @work_queue.push({ :outline => outline, :node => node})
          end
        end
      end      
    end
##
# filter! recurses down the OPML body, looking for outline tags, and pushes each
# leaf node onto a work queue
filter. recurses down the OPML body, looking for outline tags, and pushes each
leaf node onto a work queue
filter . recurses down the OPML body looking for outline tags and pushes each leaf node onto a work queue
def filter!(data)
      data.each do |node|
        if node.name == 'outline'
          outline = Outline.new(node).to_hash
          if node.children.length > 0
            title = outline[:title] || outline[:text]
            filter!(node.children)
          else
            @work_queue.push({ :outline => outline, :node => node})
          end
        end
      end      
    end
def filter! ( data ) data . each do | node | if node . name == 'outline' outline = Outline . new ( node ) . to_hash if node . children . length > 0 title = outline [ :title ] || outline [ :text ] filter! ( node . children ) else @work_queue . push ( { :outline => outline , :node => node } ) end end end end
filter!
filter!
data