Class: Taxonifi::Model::IcznName

Inherits:
Name
  • Object
show all
Defined in:
lib/taxonifi/model/name.rb

Overview

ICZN specific sublassing of a taxonomic name. !! Minimally tested and not broadly implmented.

Constant Summary

Constants inherited from Base

Base::ATTRIBUTES

Instance Attribute Summary

Attributes inherited from Name

#author, #author_year_index, #authors, #name, #original_description_reference, #parens, #parent, #rank, #related_name, #year

Attributes inherited from Base

#id, #properties, #row_number

Instance Method Summary collapse

Methods inherited from Name

#add_author_year, #author_year, #author_year_string, #derive_authors_year, #display_name, #generate_author_year_index, #genus_group?, #genus_group_parent, #index_rank, #name_author_year_string, #nomenclator_array, #nomenclator_name, #nomenclator_name?, #parent_at_rank, #parent_ids_sf_style, #parent_name_at_rank, #prologify, #species_group?

Methods inherited from Base

#add_properties, #add_property, #ancestor_ids, #ancestors, #build, #delete_property, #replace_property

Methods included from SharedClassMethods

included

Constructor Details

#initializeIcznName

Returns a new instance of IcznName.



317
318
319
# File 'lib/taxonifi/model/name.rb', line 317

def initialize
  super
end

Instance Method Details

#name=(name) ⇒ Object

Set the name, checks for family group restrictions.



322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/taxonifi/model/name.rb', line 322

def name=(name)
  case @rank
  when 'superfamily'
    raise NameError, "ICZN superfamily name does not end in 'oidae'." if name[-5,5] != 'oidae'
  when 'family'
    raise NameError, "ICZN family name does not end in 'idae'." if name[-4,4] != 'idae'
  when 'subfamily'
    raise NameError, "ICZN subfamily name does not end in 'inae'." if name[-4,4] != 'inae'
  when 'tribe'
    raise NameError, "ICZN tribe name does not end in 'ini'." if name[-3,3] != 'ini'
  when 'subtribe'
    raise NameError, "ICZN subtribe name does not end in 'ina'." if name[-3,3] != 'ina'
  end
  @name = name
end