Class: NomenclaturalRank::Icvcn::Genus

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

Constant Summary

Constants inherited from NomenclaturalRank::Icvcn

KINGDOM

Class Method Summary collapse

Methods inherited from NomenclaturalRank::Icvcn

group_base

Methods inherited from NomenclaturalRank

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

Class Method Details

.abbreviationObject



13
14
15
# File 'app/models/nomenclatural_rank/icvcn/genus.rb', line 13

def self.abbreviation
  'gen.'
end

.parent_rankObject



3
4
5
# File 'app/models/nomenclatural_rank/icvcn/genus.rb', line 3

def self.parent_rank
  NomenclaturalRank::Icvcn::Subfamily
end

.validate_name_format(taxon_name) ⇒ Object



7
8
9
10
11
# File 'app/models/nomenclatural_rank/icvcn/genus.rb', line 7

def self.validate_name_format(taxon_name)
  return true if taxon_name.name.length < 2
  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 end in -virus or -viroid or -satellite') if not(taxon_name.name =~ /.*(virus|viroid|satellite)\Z/)
end