Class: Taxon
- Inherits:
-
Data
- Object
- Data
- Taxon
- Defined in:
- lib/inat-channel/data_types.rb
Instance Attribute Summary collapse
-
#ancestors ⇒ Object
readonly
Returns the value of attribute ancestors.
-
#common_name ⇒ Object
readonly
Returns the value of attribute common_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#scientific_name ⇒ Object
readonly
Returns the value of attribute scientific_name.
Instance Method Summary collapse
Instance Attribute Details
#ancestors ⇒ Object (readonly)
Returns the value of attribute ancestors
73 74 75 |
# File 'lib/inat-channel/data_types.rb', line 73 def ancestors @ancestors end |
#common_name ⇒ Object (readonly)
Returns the value of attribute common_name
73 74 75 |
# File 'lib/inat-channel/data_types.rb', line 73 def common_name @common_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id
73 74 75 |
# File 'lib/inat-channel/data_types.rb', line 73 def id @id end |
#scientific_name ⇒ Object (readonly)
Returns the value of attribute scientific_name
73 74 75 |
# File 'lib/inat-channel/data_types.rb', line 73 def scientific_name @scientific_name end |
Instance Method Details
#icon ⇒ Object
74 75 76 |
# File 'lib/inat-channel/data_types.rb', line 74 def icon IC::ancestors_icon ancestors.map(&:id) end |
#title ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/inat-channel/data_types.rb', line 77 def title if common_name && !common_name.empty? "<b>#{common_name}</b> <i>(#{scientific_name})</i>" else "<b><i>#{scientific_name}</i></b>" end end |
#to_tags ⇒ Object
87 88 89 |
# File 'lib/inat-channel/data_types.rb', line 87 def ancestors. end |
#url ⇒ Object
84 85 86 |
# File 'lib/inat-channel/data_types.rb', line 84 def url "https://www.inaturalist.org/taxa/#{id}" end |