Class: GenomerPluginValidate::Validator::UppercaseName

Inherits:
Genomer::Plugin
  • Object
show all
Includes:
GenomerPluginValidate::Validator
Defined in:
lib/genomer-plugin-validate/validator/uppercase_name.rb

Instance Method Summary collapse

Methods included from GenomerPluginValidate::Validator

#annotations_by_attribute, load, validators

Instance Method Details

#runObject



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

def run
  annotations_by_attribute('Name').
    select{|(name,_)| name =~ /^[A-Z]/}.
    map{|(_,entry)| entry}.
    flatten.
    map{|i| [i.get_attribute('Name'),i.id]}.
    map{|i| "Illegal capitalised Name attribute '%s' for '%s'" % i}
end