Class: NomenclaturalRank::Icn::SpeciesAndInfraspeciesGroup

Inherits:
NomenclaturalRank::Icn show all
Defined in:
app/models/nomenclatural_rank/icn/species_and_infraspecies_group.rb

Direct Known Subclasses

Form, Species, Subform, Subspecies, Subvariety, Variety

Defined Under Namespace

Classes: Form, Species, Subform, Subspecies, Subvariety, Variety

Class Method Summary collapse

Methods inherited from NomenclaturalRank

abbreviation, bottom_rank, nomenclatural_code, nomenclatural_code_class, parent_rank, rank_name, top_rank, typical_use

Class Method Details

.valid_parentsObject



8
9
10
11
12
# File 'app/models/nomenclatural_rank/icn/species_and_infraspecies_group.rb', line 8

def self.valid_parents
  self.collect_descendants_to_s(
      NomenclaturalRank::Icn::GenusGroup,
      NomenclaturalRank::Icn::SpeciesAndInfraspeciesGroup)
end

.validate_name_format(taxon_name) ⇒ Object



3
4
5
6
# File 'app/models/nomenclatural_rank/icn/species_and_infraspecies_group.rb', line 3

def self.validate_name_format(taxon_name)
 taxon_name.errors.add(:name, 'name must be lower case') unless taxon_name.name == taxon_name.name.downcase
 taxon_name.errors.add(:name, 'name must be at least two letters') unless taxon_name.name.length > 1
end