Class: Descriptor::Qualitative

Inherits:
Descriptor show all
Defined in:
app/models/descriptor/qualitative.rb

Overview

A descriptor that has qualitative states. For example a phylogenetic character. Also used for descriptive matrices. Note that presence/absence descriptors have their own subclass and should be represented there to maximize utility.

Constant Summary

Constants inherited from Descriptor

ALTERNATE_VALUES_FOR

Constants included from SoftValidation

SoftValidation::ANCESTORS_WITH_SOFT_VALIDATIONS

Instance Method Summary collapse

Methods inherited from Descriptor

#gene?, human_name, #observation_type, #presence_absence?, #qualitative?, #short_name_is_shorter, #sv_short_name_is_short, #target_name, #type_is_subclassed

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::Documentation

#document_array=, #documented?, #reject_documentation, #reject_documents

Methods included from Shared::Confidences

#reject_confidences

Methods included from Shared::AlternateValues

#all_values_for, #alternate_valued?

Methods included from Shared::DataAttributes

#import_attributes, #internal_attributes, #keyword_value_hash, #reject_data_attributes

Methods included from Shared::Depictions

#has_depictions?, #image_array=, #reject_depictions, #reject_images

Methods included from Shared::Notes

#concatenated_notes_string, #reject_notes

Methods included from Shared::Tags

#reject_tags, #tag_with, #tagged?, #tagged_with?

Methods included from Shared::Identifiers

#dwc_occurrence_id, #identified?, #next_by_identifier, #previous_by_identifier, #reject_identifiers, #uri, #uuid

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

Instance Method Details

#has_gap_state?Boolean

Returns:

  • (Boolean)


10
11
12
13
14
15
16
# File 'app/models/descriptor/qualitative.rb', line 10

def has_gap_state?
  character_states.each do |c|
    return true if c.is_gap?
  end

  false
end

#reject_character_states(attributes) ⇒ Object (protected)



20
21
22
# File 'app/models/descriptor/qualitative.rb', line 20

def reject_character_states(attributes)
  attributes[:name].blank? || attributes[:label].blank?
end