class Bio::BlastXMLParser::NokogiriBlastXml
Public Class Methods
new(document)
click to toggle source
# File lib/bio/db/blast/parser/nokogiri.rb, line 180 def initialize document @xml = document end
Public Instance Methods
each(&block)
click to toggle source
# File lib/bio/db/blast/parser/nokogiri.rb, line 190 def each &block doc = Nokogiri::XML(@xml) { | cfg | cfg.noblanks } doc.root.children.each do |blastnode| if blastnode.name == 'BlastOutput_iterations' blastnode.children.each do | iteration | if iteration.name == 'Iteration' block.call(NokogiriBlastIterator.new(iteration,self)) end end end end end
to_enum()
click to toggle source
# File lib/bio/db/blast/parser/nokogiri.rb, line 184 def to_enum Enumerator.new { |yielder| each { | iterator | yielder.yield(iterator) } } end