Class: Catalog::Distribution::EntryItem

Inherits:
EntryItem
  • Object
show all
Defined in:
lib/catalog/distribution/entry_item.rb

Instance Attribute Summary collapse

Attributes inherited from EntryItem

#base_object, #citation, #is_first, #is_last, #matches_current_target, #nomenclature_date, #object, #pages, #to_html_method, #year_suffix

Instance Method Summary collapse

Methods inherited from EntryItem

#base_data_attributes, #cited?, #cited_class, #in_source?, #object_class, #origin, #references_self?, #source, #topics

Constructor Details

#initialize(params = {}) ⇒ EntryItem

Returns a new instance of EntryItem.



7
8
9
10
11
# File 'lib/catalog/distribution/entry_item.rb', line 7

def initialize(params = {})
  super(**params)
  # geographic_name_classification
  true
end

Instance Attribute Details

#geographic_name_classificationObject

Returns the value of attribute geographic_name_classification.



5
6
7
# File 'lib/catalog/distribution/entry_item.rb', line 5

def geographic_name_classification
  @geographic_name_classification
end

Instance Method Details

#countryObject



46
47
48
# File 'lib/catalog/distribution/entry_item.rb', line 46

def country
  @geographic_name_classification[:country]
end

#countyObject



54
55
56
# File 'lib/catalog/distribution/entry_item.rb', line 54

def county
  @geographic_name_classification[:county]
end

#data_attributesObject



22
23
24
25
26
27
# File 'lib/catalog/distribution/entry_item.rb', line 22

def data_attributes
  base_data_attributes.merge(
    'history-otu-taxon-name-id' => taxon_name_global_id,
    'history-is-valid' => linked_to_valid_taxon_name?
  )
end

#html_helperObject



13
14
15
# File 'lib/catalog/distribution/entry_item.rb', line 13

def html_helper
  :otu_catalog_entry_item_tag
end

#linked_to_valid_taxon_name?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/catalog/distribution/entry_item.rb', line 18

def linked_to_valid_taxon_name?
  object.taxon_name&.is_valid?
end

#stateObject



50
51
52
# File 'lib/catalog/distribution/entry_item.rb', line 50

def state
  @geographic_name_classification[:state]
end

#taxon_name_global_idObject



29
30
31
# File 'lib/catalog/distribution/entry_item.rb', line 29

def taxon_name_global_id
  object&.taxon_name&.to_global_id&.to_s
end