Class: TaxonNameClassification::Latinized::PartOfSpeech::Adjective

Inherits:
TaxonNameClassification::Latinized::PartOfSpeech show all
Defined in:
app/models/taxon_name_classification/latinized/part_of_speech/adjective.rb

Constant Summary collapse

NOMEN_URI =
'http://purl.obolibrary.org/obo/NOMEN_0000050'.freeze

Constants included from SoftValidation

SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS

Instance Attribute Summary

Attributes inherited from TaxonNameClassification

#project_id, #taxon_name_id, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TaxonNameClassification::Latinized::PartOfSpeech

applicable_ranks, #set_gender_in_taxon_name, #validate_uniqueness_of_latinized

Methods inherited from TaxonNameClassification

#annotated_object, annotates?, applicable_ranks, #classification_label, code_applicability_end_year, code_applicability_start_year, collect_descendants_and_itself_to_s, collect_descendants_to_s, collect_to_s, gbif_status, label, #nomen_id, nomen_uri, #nomenclature_code, #nomenclature_code_matches, parent, possible_genus_endings, possible_species_endings, questionable_species_endings, #set_cached_names_for_taxon_names, #sv_fix_proper_classification, #sv_proper_classification, #sv_proper_year, #sv_validate_disjoint_classes, #type_class, #type_class=, #type_name, #validate_taxon_name_classification, #validate_uniqueness_of_latinized

Methods included from SoftValidation

#clear_soft_validations, #fix_for, #fix_soft_validations, #soft_fixed?, #soft_valid?, #soft_validate, #soft_validated?, #soft_validations, #soft_validators

Methods included from Shared::IsData

#errors_excepting, #full_error_messages_excepting, #identical, #is_community?, #is_destroyable?, #is_editable?, #is_in_use?, #is_in_users_projects?, #metamorphosize, #similar

Methods included from Shared::Notes

#concatenated_notes_string, #reject_notes

Methods included from Shared::Citations

#cited?, #mark_citations_for_destruction, #nomenclature_date, #origin_citation_source_id, #reject_citations, #requires_citation?, #sources_by_topic_id

Methods included from Housekeeping

#has_polymorphic_relationship?

Methods inherited from ApplicationRecord

transaction_with_retry

Class Method Details

.assignableObject



12
13
14
# File 'app/models/taxon_name_classification/latinized/part_of_speech/adjective.rb', line 12

def self.assignable
  true
end

.disjoint_taxon_name_classesObject



5
6
7
8
9
10
# File 'app/models/taxon_name_classification/latinized/part_of_speech/adjective.rb', line 5

def self.disjoint_taxon_name_classes
  self.parent.disjoint_taxon_name_classes +
      self.collect_descendants_and_itself_to_s(TaxonNameClassification::Latinized::PartOfSpeech::NounInApposition,
                                               TaxonNameClassification::Latinized::PartOfSpeech::NounInGenitiveCase,
                                               TaxonNameClassification::Latinized::PartOfSpeech::Participle)
end

Instance Method Details

#set_cachedObject



16
17
18
19
# File 'app/models/taxon_name_classification/latinized/part_of_speech/adjective.rb', line 16

def set_cached
  set_gender_in_taxon_name
  super
end

#sv_not_specific_classesObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/models/taxon_name_classification/latinized/part_of_speech/adjective.rb', line 21

def sv_not_specific_classes
  t = taxon_name.name
  if !t.end_with?('us') &&
      !t.end_with?('a') &&
      !t.end_with?('um') &&
      !t.end_with?('is') &&
      !t.end_with?('e') &&
      !t.end_with?('or') &&
      !t.end_with?('er')
    if taxon_name.name != taxon_name.masculine_name || taxon_name.name != taxon_name.feminine_name || taxon_name.name != taxon_name.neuter_name
      soft_validations.add(:type, 'Declinable adjective name should end with one of the following endings: -us, -a, -um, -is, -e, -er, -or')
    end
  end
end