class Bio::FlatFile::AutoDetect::RuleRegexp
A autodetection rule to use a regular expression
Public Class Methods
new(dbclass, re)
click to toggle source
Creates a new instance.
Calls superclass method
Bio::FlatFile::AutoDetect::RuleTemplate::new
# 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
Public Instance Methods
dbclasses()
click to toggle source
returns database classes
# File lib/bio/io/flatfile/autodetection.rb 163 def dbclasses 164 [ dbclass ] 165 end
guess(text, meta)
click to toggle source
If given text matches the regexp, returns the database class. Otherwise, returns nil or false. meta is ignored.
# File lib/bio/io/flatfile/autodetection.rb 170 def guess(text, meta) 171 @re =~ text ? dbclass : nil 172 end