Module: TaxonDeterminationsHelper

Defined in:
app/helpers/taxon_determinations_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (String) determination_tag(taxon_determination)

Returns as for taxon_determination_tag but does not reference collection object

Returns:

  • (String)

    as for taxon_determination_tag but does not reference collection object



12
13
14
15
16
17
18
# File 'app/helpers/taxon_determinations_helper.rb', line 12

def determination_tag(taxon_determination)
  return nil if taxon_determination.nil?
  [ taxon_determination_name(taxon_determination),
    taxon_determination_by(taxon_determination),
    taxon_determination_on(taxon_determination)
  ].join(" ")
end

- (String) taxon_determination_by(taxon_determination)

Returns the “by” clause of the determination

Returns:

  • (String)

    the “by” clause of the determination



37
38
39
40
# File 'app/helpers/taxon_determinations_helper.rb', line 37

def taxon_determination_by(taxon_determination)
  names = taxon_determination.determiners.collect{|d| d.last_name }
  names == [] ? nil :  "by #{names.join(', ')}"
end

Returns as for taxon_determination_tag but does not reference collection object, links to OTU

Returns:

  • (String)

    as for taxon_determination_tag but does not reference collection object, links to OTU



22
23
24
25
26
27
# File 'app/helpers/taxon_determinations_helper.rb', line 22

def taxon_determination_link(taxon_determination)
  [ link_to(taxon_determination_name(taxon_determination), taxon_determination.otu),
    taxon_determination_by(taxon_determination),
    taxon_determination_on(taxon_determination)
  ].join(" ").html_safe
end

- (String) taxon_determination_name(taxon_determination)

Returns as for taxon_determination_tag but does not reference collection object

Returns:

  • (String)

    as for taxon_determination_tag but does not reference collection object



31
32
33
# File 'app/helpers/taxon_determinations_helper.rb', line 31

def taxon_determination_name(taxon_determination)
  otu_autocomplete_selected_tag(taxon_determination.otu)
end

- (String) taxon_determination_on(taxon_determination)

Returns the date clause of the determination

Returns:

  • (String)

    the date clause of the determination



44
45
46
# File 'app/helpers/taxon_determinations_helper.rb', line 44

def taxon_determination_on(taxon_determination)
  taxon_determination.date ? "on #{taxon_determination.date}" : nil
end

- (String?) taxon_determination_tag(taxon_determination)

Returns a descriptor, contains name only (if you want to include the identifier use collection_object_tag)

Returns:

  • (String, nil)

    a descriptor, contains name only (if you want to include the identifier use collection_object_tag)



5
6
7
8
# File 'app/helpers/taxon_determinations_helper.rb', line 5

def taxon_determination_tag(taxon_determination) 
  return nil if taxon_determination.nil?
  ['determined as', determination_tag(taxon_determination) ].join(" ")
end