Class: NomenclaturalRank::Icnb::GenusGroup

Inherits:
NomenclaturalRank::Icnb show all
Defined in:
app/models/nomenclatural_rank/icnb/genus_group.rb

Direct Known Subclasses

Genus, Subgenus

Defined Under Namespace

Classes: Genus, Subgenus

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods inherited from NomenclaturalRank::Icnb

group_base

Methods inherited from NomenclaturalRank

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

Class Method Details

+ (Object) valid_parents



12
13
14
15
16
# File 'app/models/nomenclatural_rank/icnb/genus_group.rb', line 12

def self.valid_parents
  self.collect_descendants_to_s(
      NomenclaturalRank::Icnb::FamilyGroup,
      NomenclaturalRank::Icnb::GenusGroup)
end

+ (Object) validate_name_format(taxon_name)



3
4
5
6
# File 'app/models/nomenclatural_rank/icnb/genus_group.rb', line 3

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

Instance Method Details

- (Object) parent_rank



8
9
10
# File 'app/models/nomenclatural_rank/icnb/genus_group.rb', line 8

def parent_rank
  nil
end