class Bio::FlatFile::AutoDetect::RuleRegexp
A autodetection rule to use a regular expression
Public Class Methods
Source
# File lib/bio/io/flatfile/autodetection.rb 145 def initialize(dbclass, re) 146 super() 147 @re = re 148 @name = dbclass.to_s 149 @dbclass = nil 150 @dbclass_lazy = dbclass 151 end
Creates a new instance.
Calls superclass method
Bio::FlatFile::AutoDetect::RuleTemplate::new
Public Instance Methods
Source
# File lib/bio/io/flatfile/autodetection.rb 163 def dbclasses 164 [ dbclass ] 165 end
returns database classes
Source
# File lib/bio/io/flatfile/autodetection.rb 170 def guess(text, meta) 171 @re =~ text ? dbclass : nil 172 end
If given text matches the regexp, returns the database class. Otherwise, returns nil or false. meta is ignored.