Class: NomenclaturalRank::Icvcn

Inherits:
NomenclaturalRank show all
Defined in:
app/models/nomenclatural_rank/icvcn.rb

Direct Known Subclasses

ClassRank, Family, Genus, Kingdom, Order, Phylum, Realm, Species, Subfamily

Defined Under Namespace

Classes: ClassRank, Family, Genus, Kingdom, Order, Phylum, Realm, Species, Subfamily

Constant Summary collapse

KINGDOM =
['Viruses']

Class Method Summary collapse

Methods inherited from NomenclaturalRank

abbreviation, bottom_rank, collect_descendants_to_s, collect_to_s, nomenclatural_code, nomenclatural_code_class, ordered_ranks, parent, parent_rank, rank_name, top_rank, typical_use, valid_name_ending, valid_parents

Class Method Details

.group_base(rank_string) ⇒ Object



5
6
7
8
# File 'app/models/nomenclatural_rank/icvcn.rb', line 5

def self.group_base(rank_string)
  rank_string.match( /(NomenclaturalRank::Icvcn::).+/)
  $1
end

.validate_name_format(taxon_name) ⇒ Object



10
11
12
13
# File 'app/models/nomenclatural_rank/icvcn.rb', line 10

def self.validate_name_format(taxon_name)
  taxon_name.errors.add(:name, 'name must be capitalized') unless !taxon_name.name.blank? && taxon_name.name == taxon_name.name.capitalize
  taxon_name.errors.add(:name, 'name must be at least two letters') unless taxon_name.name.length > 1
end