Method: Bio::Blat::Report#add_header_line

Defined in:
lib/bio/appl/blat/report.rb

#add_header_line(line) ⇒ Object

Adds a header line if the header data is not yet given and the given line is suitable for header. Returns self if adding header line is succeeded. Otherwise, returns false (the line is not added).



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/bio/appl/blat/report.rb', line 84

def add_header_line(line)
  return false if defined? @columns
  line = line.chomp
  case line
  when /^\d/
    @columns = (defined? @header_lines) ? parse_header(@header_lines) : []
    return false
  when /\A\-+\s*\z/
    @columns = (defined? @header_lines) ? parse_header(@header_lines) : []
    return self
  else
    @header_lines ||= []
    @header_lines.push line
  end
end