Class Bio::FlatFile::AutoDetect::RuleTemplate
In: lib/bio/io/flatfile.rb  (CVS)
Parent: Object

Template of a single rule of autodetection

Methods

[]   guess   is_prior_to   new  

Attributes

dbclasses  [R]  database classes
higher_priority_elements  [R]  higher priority elements
lower_priority_elements  [R]  lower priority elements
name  [RW]  unique name of the element

Public Class methods

Creates a new element.

[Source]

# File lib/bio/io/flatfile.rb, line 796
        def self.[](*arg)
          self.new(*arg)
        end

Creates a new element.

[Source]

# File lib/bio/io/flatfile.rb, line 801
        def initialize
          @higher_priority_elements = RulesArray.new
          @lower_priority_elements  = RulesArray.new
          @name = nil
        end

Public Instance methods

If given text (and/or meta information) is known, returns the database class. Otherwise, returns nil or false.

text will be a String. meta will be a Hash. meta may contain following keys. :path => pathname, filename or uri.

[Source]

# File lib/bio/io/flatfile.rb, line 834
        def guess(text, meta)
          nil
        end

self is prior to the elem.

[Source]

# File lib/bio/io/flatfile.rb, line 808
        def is_prior_to(elem)
          return nil if self == elem
          elem.higher_priority_elements << self
          self.lower_priority_elements << elem
          true
        end

[Validate]