Method: Bio::FlatFile.foreach

Defined in:
lib/bio/io/flatfile.rb

.foreach(*arg) ⇒ Object

Executes the block for every entry in the stream. Same as FlatFile.open(*arg) { |ff| ff.each { |entry| … }}.

  • Example

    Bio::FlatFile.foreach('test.fst') { |e| puts e.definition }
    


194
195
196
197
198
199
200
# File 'lib/bio/io/flatfile.rb', line 194

def self.foreach(*arg)
  self.open(*arg) do |flatfileobj|
    flatfileobj.each do |entry|
      yield entry
    end
  end
end