Class: Catalog::Otu::Entry
- Inherits:
-
Entry
- Object
- Entry
- Catalog::Otu::Entry
- Defined in:
- lib/catalog/otu/entry.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#entry_item_matches_target?(item_object, reference_object) ⇒ Boolean
This is the MM result.
- #from_self ⇒ Object
-
#initialize(otu) ⇒ Entry
constructor
A new instance of Entry.
- #to_html_method ⇒ Object
Constructor Details
#initialize(otu) ⇒ Entry
Returns a new instance of Entry.
6 7 8 9 |
# File 'lib/catalog/otu/entry.rb', line 6 def initialize(otu) super(otu) true end |
Instance Method Details
#build ⇒ Object
11 12 13 14 |
# File 'lib/catalog/otu/entry.rb', line 11 def build from_self true end |
#entry_item_matches_target?(item_object, reference_object) ⇒ Boolean
Returns this is the MM result.
50 51 52 |
# File 'lib/catalog/otu/entry.rb', line 50 def entry_item_matches_target?(item_object, reference_object) item_object.taxon_name_id == reference_object.taxon_name_id end |
#from_self ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/catalog/otu/entry.rb', line 20 def from_self a = ::Otu.coordinate_otus(object.id).load # It's just this OTU, and it's never been cited, # or cross-referenced to another name, etc. if a.size == 1 && object.citations.none? @items << Catalog::Otu::EntryItem.new( object: object, base_object: object, current_target: true # by definition? ) end a.each do |o| matches_target = entry_item_matches_target?(o, object) o.citations.each do |c| @items << Catalog::Otu::EntryItem.new( object: o, base_object: object, citation: c, nomenclature_date: c.source&.cached_nomenclature_date, current_target: matches_target ) end end end |
#to_html_method ⇒ Object
16 17 18 |
# File 'lib/catalog/otu/entry.rb', line 16 def to_html_method :otu_catalog_entry_item_to_html end |