Bio::FlatFile::AutoDetect::RuleTemplate
A autodetection rule to use a regular expression
Creates a new instance.
# File lib/bio/io/flatfile/autodetection.rb, line 145 def initialize(dbclass, re) super() @re = re @name = dbclass.to_s @dbclass = nil @dbclass_lazy = dbclass end
returns database classes
# File lib/bio/io/flatfile/autodetection.rb, line 163 def dbclasses [ dbclass ] end
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, line 170 def guess(text, meta) @re =~ text ? dbclass : nil end
[Validate]
Generated with the Darkfish Rdoc Generator 2.