Class: Lederhosen::UCParser

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/lederhosen/uc_parser.rb

Overview

class for parsing UC files, generates UResult objects

Instance Method Summary collapse

Constructor Details

#initialize(handle) ⇒ UCParser

Returns a new instance of UCParser.



41
42
43
# File 'lib/lederhosen/uc_parser.rb', line 41

def initialize(handle)
  @handle = handle
end

Instance Method Details

#each(&block) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/lederhosen/uc_parser.rb', line 45

def each(&block)
  @handle.each do |line|
    next if line =~ /^[#C]/ # skip comments and cluster summaries
    dat = parse_usearch_line(line.strip)
    result = UResult.new(dat)
    block.call(result)
  end
end