Module: GenomerPluginValidate::Validator

Included in:
BadProductField, DuplicateID, MissingID, NoNameOrProduct, UppercaseName
Defined in:
lib/genomer-plugin-validate/validator.rb

Defined Under Namespace

Classes: BadProductField, DuplicateCoordinates, DuplicateID, Gff3Attributes, MissingID, NoNameOrProduct, UppercaseName, ViewAttributes

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loadObject



5
6
7
8
9
10
# File 'lib/genomer-plugin-validate/validator.rb', line 5

def self.load
  path = File.join(File.dirname(__FILE__),'..','genomer-plugin-validate','validator','*')
  Dir[path].each do |i|
    require i if i =~ /\.rb/
  end
end

.validatorsObject



12
13
14
15
16
17
# File 'lib/genomer-plugin-validate/validator.rb', line 12

def self.validators
  load
  Hash[constants.map do |name|
    [name.to_s.underscore.to_sym, const_get(name)]
  end]
end

Instance Method Details

#annotations_by_attribute(attr) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/genomer-plugin-validate/validator.rb', line 19

def annotations_by_attribute(attr)
  annotations.inject(Hash.new{|h,k| h[k] = []}) do |hash,attn|
    attr_value = attn.get_attribute(attr) ? attn.get_attribute(attr).to_s : nil
    hash[attr_value] <<= attn
    hash
  end
end