Class | Bio::FlatFile::AutoDetect::RuleTemplate
In: | lib/bio/io/flatfile/autodetection.rb
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

[](*arg)

Creates a new element.

[Source]

        # File lib/bio/io/flatfile/autodetection.rb, line 38
    38:         def self.[](*arg)
    39:           self.new(*arg)
    40:         end

new()

Creates a new element.

[Source]

        # File lib/bio/io/flatfile/autodetection.rb, line 43
    43:         def initialize
    44:           @higher_priority_elements = RulesArray.new
    45:           @lower_priority_elements  = RulesArray.new
    46:           @name = nil
    47:         end

### Public Instance methods

guess(text, meta)

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/autodetection.rb, line 76
    76:         def guess(text, meta)
    77:           nil
    78:         end

is_prior_to(elem)

self is prior to the elem.

[Source]

        # File lib/bio/io/flatfile/autodetection.rb, line 50
    50:         def is_prior_to(elem)
    51:           return nil if self == elem
    52:           elem.higher_priority_elements << self
    53:           self.lower_priority_elements << elem
    54:           true
    55:         end

[Validate]