Class: Eol::DataObjects

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/eol/data_objects.rb

Overview

Contains all metadata about the object as submitted to EOL by the contributing content partner.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ DataObjects

Returns a new instance of DataObjects.



25
26
27
28
29
30
31
32
# File 'lib/eol/data_objects.rb', line 25

def initialize(response)
  self.identifier = response['identifier']
  self.scientific_name = response['scientificName']
  self.exemplar = response['exemplar']
  self.richness_score = response['richness_score']
  self.taxon_concepts = response['taxonConcepts']
  self.data_objects = response['dataObjects']
end

Instance Attribute Details

#data_objectsArray

Returns An Array of Hashes.

Returns:

  • (Array)

    An Array of Hashes



23
24
25
# File 'lib/eol/data_objects.rb', line 23

def data_objects
  @data_objects
end

#exemplarFalseClass or TrueClass

Returns status of exemplar.

Returns:

  • (FalseClass or TrueClass)

    status of exemplar



13
14
15
# File 'lib/eol/data_objects.rb', line 13

def exemplar
  @exemplar
end

#identifierInteger

Returns an identifier number.

Returns:

  • (Integer)

    an identifier number



9
10
11
# File 'lib/eol/data_objects.rb', line 9

def identifier
  @identifier
end

#richness_scoreInteger

EOL has developed a ‘Richness Score’ for taxon pages which provides a simple summary number for comparing the amount of information available for different pages.

Returns:

  • (Integer)

See Also:



19
20
21
# File 'lib/eol/data_objects.rb', line 19

def richness_score
  @richness_score
end

#scientific_nameString

Returns the binomial nomenclature in zoology.

Returns:

  • (String)

    the binomial nomenclature in zoology



11
12
13
# File 'lib/eol/data_objects.rb', line 11

def scientific_name
  @scientific_name
end

#taxon_conceptsArray

Returns An Array of Hashes.

Returns:

  • (Array)

    An Array of Hashes



21
22
23
# File 'lib/eol/data_objects.rb', line 21

def taxon_concepts
  @taxon_concepts
end

Instance Method Details

#each {|@identifier| ... } ⇒ Object

Yields:



34
35
36
37
38
39
40
41
# File 'lib/eol/data_objects.rb', line 34

def each
  yield @identifier
  yield @scientific_name
  yield @exemplar
  yield @richness_score
  yield @taxon_concepts
  yield @data_objects
end