Sha256: b7b21ce2e59373592c7c2ca157d39fba08b49679a179f9fe751d77bebbf42f13

Contents?: true

Size: 629 Bytes

Versions: 2

Compression:

Stored size: 629 Bytes

Contents

require 'extensions/string'

module GenomerPluginValidate::Validator

  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

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

  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

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
genomer-plugin-validate-0.0.2 lib/genomer-plugin-validate/validator.rb
genomer-plugin-validate-0.0.1 lib/genomer-plugin-validate/validator.rb