Class: Casento::Occurrence
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Casento::Occurrence
- Defined in:
- lib/casento/occurrence.rb
Instance Method Summary collapse
- #dwc_class ⇒ Object
- #infraspecificEpithet ⇒ Object
- #kingdom ⇒ Object
- #name ⇒ Object
- #phylum ⇒ Object
- #scientificName ⇒ Object
- #species ⇒ Object
- #specificEpithet ⇒ Object
- #state ⇒ Object
- #stateProvince ⇒ Object
Instance Method Details
#dwc_class ⇒ Object
12 13 14 |
# File 'lib/casento/occurrence.rb', line 12 def dwc_class "Insecta" end |
#infraspecificEpithet ⇒ Object
20 21 22 |
# File 'lib/casento/occurrence.rb', line 20 def infraspecificEpithet subspecies end |
#kingdom ⇒ Object
4 5 6 |
# File 'lib/casento/occurrence.rb', line 4 def kingdom "Animalia" end |
#name ⇒ Object
57 58 59 |
# File 'lib/casento/occurrence.rb', line 57 def name [genus, species, subspecies].compact.join(" ").strip end |
#phylum ⇒ Object
8 9 10 |
# File 'lib/casento/occurrence.rb', line 8 def phylum "Arthropoda" end |
#scientificName ⇒ Object
24 25 26 |
# File 'lib/casento/occurrence.rb', line 24 def scientificName name end |
#species ⇒ Object
61 62 63 |
# File 'lib/casento/occurrence.rb', line 61 def species super =~ /spp/ ? nil : super end |
#specificEpithet ⇒ Object
16 17 18 |
# File 'lib/casento/occurrence.rb', line 16 def specificEpithet species end |
#state ⇒ Object
28 29 30 |
# File 'lib/casento/occurrence.rb', line 28 def state super.gsub(/\(state of\)/i, "").strip end |
#stateProvince ⇒ Object
32 33 34 |
# File 'lib/casento/occurrence.rb', line 32 def stateProvince state end |