Class | Bio::FlatFile::AutoDetect::RuleRegexp2
In: | lib/bio/io/flatfile/autodetection.rb
Parent: | RuleRegexp

A autodetection rule to use more than two regular expressions. If given string matches one of the regular expressions, returns the database class.

### Methods

guess new

### Public Class methods

new(dbclass, *regexps)

Creates a new instance.

[Source]

         # File lib/bio/io/flatfile/autodetection.rb, line 180
    180:         def initialize(dbclass, *regexps)
    181:           super(dbclass, nil)
    182:           @regexps = regexps
    183:         end

### Public Instance methods

guess(text, meta)

If given text matches one of the regexp, returns the database class. Otherwise, returns nil or false. meta is ignored.

[Source]

         # File lib/bio/io/flatfile/autodetection.rb, line 188
    188:         def guess(text, meta)
    189:           @regexps.each do |re|
    190:             return dbclass if re =~ text
    191:           end
    192:           nil
    193:         end

[Validate]