Sha256: 35b3a259e3a219798536d9c8142fe784e5ed41f9f3a568ea53d1022f6dcc5f39

Contents?: true

Size: 457 Bytes

Versions: 2

Compression:

Stored size: 457 Bytes

Contents

class GenomerPluginValidate::Validator::ViewAttributes < Genomer::Plugin

  def valid_view_attributes
    %w|product ec_number function feature_type|
  end

  def run
    annotations.
      map{|attn| attn.attributes.map{|(k,v)| [k,attn] }}.
      flatten(1).
      select{|(term,_)| term =~ (/^[a-z]/) }.
      reject{|(term,_)| valid_view_attributes.include? term }.
      map{|(term,attn)| "Illegal view attribute '#{term}' for '#{attn.id}'"}
  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/view_attributes.rb
genomer-plugin-validate-0.0.1 lib/genomer-plugin-validate/validator/view_attributes.rb