Class: Eol::Hierarchies

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

Overview

Contains metadata about a hierarchy such as the provider name and source URL, as well as lists all the taxa which are the root taxa of the taxonomic tree

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Hierarchies

Returns a new instance of Hierarchies.



19
20
21
22
23
24
25
# File 'lib/eol/hierarchies.rb', line 19

def initialize(response)
  self.title = response['title']
  self.contributor = response['contributor']
  self. = response['dateSubmitted']
  self.source = response['source']
  self.roots = response['roots']
end

Instance Attribute Details

#contributorString

Returns the name of the Hierarchies contributor.

Returns:

  • (String)

    the name of the Hierarchies contributor



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

def contributor
  @contributor
end

#date_submittedString

Returns date of submission.

Returns:

  • (String)

    date of submission



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

def 
  
end

#rootsArray

Returns An Array of Hashes.

Returns:

  • (Array)

    An Array of Hashes



17
18
19
# File 'lib/eol/hierarchies.rb', line 17

def roots
  @roots
end

#sourceString

Returns the Hierarchies source.

Returns:

  • (String)

    the Hierarchies source



15
16
17
# File 'lib/eol/hierarchies.rb', line 15

def source
  @source
end

#titleString

Returns the Hierarchies title.

Returns:

  • (String)

    the Hierarchies title



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

def title
  @title
end

Instance Method Details

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

Yields:



27
28
29
30
31
32
33
# File 'lib/eol/hierarchies.rb', line 27

def each
  yield @title
  yield @contributor
  yield 
  yield @source
  yield @roots
end